T8 React Store

Concise approach to React app state management aligned with React's state pattern, condensed to the essentials

Docs GitHub

npm i @t8/react-store

+ let store = new Store(0);

  let Counter = () => {
-   let [counter, setCounter] = useState(0);
+   let [counter, setCounter] = useStore(store);

    let handleClick = () => {
      setCounter(value => value + 1);
    };

    return <button onClick={handleClick}>+ {counter}</button>;
  };
  • Similar to useState()
  • No boilerplate
  • Quick transition from local state
  • Easily integrates with Immer
  • SSR- and CSR-compatible