Skip to content

dytra/react-storage-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-storage-helper

A custom React hook for managing data from localStorage easily.

npm version

Installation

npm install react-storage-helper

Usage

import React from 'react';
import useLocalStorage from 'react-storage-helper';

const MyComponent = () => {
  const [data, setData, deleteData] = useLocalStorage('mySecret');

  return (
    <div>
      <p>Data from localStorage: {data}</p>
      <button onClick={() => setData('new value')}>Update Data</button>
      <button onClick={deleteData}>Delete Data</button>
    </div>
  );
};

export default MyComponent;

About

custom react hook for managing localstorage at ease

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published