-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mostafa Rastegar edited this page Jun 1, 2025
·
3 revisions
β‘ Ultra-lightweight state management for React 18+ applications (~950B gzipped)
Welcome to the comprehensive guide for React ConStore! This wiki will help you master modern React state management with minimal overhead.
| π¦ NPM Package | π Bundle Size | β GitHub Stars | π₯ Downloads |
|---|---|---|---|
| react-constore | ~950B gzipped | β Star us! | π NPM Trends |
npm install react-constore
'use client'; // for Next.js App Router
import createStore from 'react-constore';
// 1. Create your store
const store = createStore({
count: 0,
user: { name: 'Guest', age: 25 }
});
// 2. Use in components
function Counter() {
const [count, setCount] = store.useStoreKey('count');
return (
<div>
<h2>Count: {count}</h2>
<button onClick={() => setCount(count + 1)}>
Increment
</button>
</div>
);
}
// 3. Components automatically sync! π