1.0.5 • Published 3 years ago

uselocalstorage-react-hook v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

NPM npm.io npm.io

Uselocalstorage-React-Hook

npm.io

This is an amazing package that will help you add local storage variables easily in your react app.

🛠️ Installation

  1. Install using npm
npm i uselocalstorage-react-hook
  1. Add to your project
import useLocalStorage from "uselocalstorage-react-hook";
  1. Start using uselocalstorage-react-hook
const [name, setName] = useLocalStorage("name", "John Doe");

💻 Example Code

import React from "react";
import "./styles.css";
import useLocalStorage from "uselocalstorage-react-hook";

const App = () => {
  const [name, setName] = useLocalStorage("name", "John Doe");

  return (
    <div>
      <input
        type="text"
        value={name}
        onChange={(e) => setName(e.target.value)}
      />
      <h1>{name}</h1>
      <p>Refresh this page, the name remains the same. 🤟</p>
    </div>
  );
};

export default App;

🦄 Live Demo

npm.io

npm.io

npm.io

🙌 Thanks

Thanks to everyone who contributed to the development of this project.

If you enjoyed, go follow me on Twitter 💖

🛡️ License

MIT Licensed. Copyright (c) Savio Martin.

1.0.2

3 years ago

1.0.1

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

1.0.0

3 years ago