persistent-state-react
v1.0.0
Published
A react package to manage persistant storage w localstorage and hook
Maintainers
Readme
🚀 persistent-state-react 📦✨
Easily manage persistent state in React using localStorage with this lightweight and efficient hook! 🏆🔥
📦 Installation 💻🔧
👉 Run this command in your terminal:
npm i persistent-state-react🎯 Or, directly add it to your package.json:
"persistent-state-react": "^1.0.0"🚀 Example 🛠️✨
⚛️ React.js 🏗️
import { usePersistentState } from "persistent-state-react";
function MyComponent() {
const [count, setCount] = usePersistentState("count", 0);
return (
<div>
<p>Count: {count}</p>
<button onClick={() => setCount(prev => prev + 1)}>➕ Increment</button>
</div>
);
}🏆 Features 🛠️
✅ Simple API ✨
✅ Persistent state using localStorage 💾
✅ Works with any React component ⚛️
✅ Zero dependencies 📦
✅ Super lightweight & efficient ⚡
🎉 Happy coding! 🚀🔥
