Skip to content
React Hook for Local Storage
JavaScript HTML CSS
Branch: master
Clone or download
Latest commit 7d5933b Nov 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example init create-react-library@2.6.7 Nov 3, 2019
src update Nov 5, 2019
.babelrc init create-react-library@2.6.7 Nov 3, 2019
.editorconfig init create-react-library@2.6.7 Nov 3, 2019
.eslintrc
.gitignore init create-react-library@2.6.7 Nov 3, 2019
.travis.yml init create-react-library@2.6.7 Nov 3, 2019
README.md update Nov 5, 2019
package-lock.json init create-react-library@2.6.7 Nov 3, 2019
package.json init create-react-library@2.6.7 Nov 3, 2019
rollup.config.js init create-react-library@2.6.7 Nov 3, 2019

README.md

local-storage-hook

React Hook for Local Storage

NPM JavaScript Style Guide

Install

npm add local-storage-hook

Signature

const [localState, setLocalState] = useLocalStorage(key, defaultValue);

Usage

import React from 'react'

import useLocalStorage from 'local-storage-hook'

export default () => {
  
  // const [localState, setLocalState] = useLocalStorage(key, defaultValue);
  const [login, setLogin] = useLocalStorage("login", false);

  return (
    <div>
      Hello
    </div>
  );
}

License

GPLV3 © akash-joshi

You can’t perform that action at this time.