1.2.0 • Published 4 years ago

local-storage-hook v1.2.0

Weekly downloads
26
License
GPLV3
Repository
github
Last release
4 years ago

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