re-state
Getting Started

Install

Install re-state with the package manager already used by your application:

npm install @raulpesilva/re-state

That is all the setup you need. There is no provider to add to your component tree.

re-state supports React 16.8 and newer. React DOM is an optional peer dependency for web applications, while React Native automatically uses the package's native export.

You can now import an API and create your first shared value:

import { useReState } from '@raulpesilva/re-state';

export function Counter() {
  const [count, setCount] = useReState('count', 0);
  return <button onClick={() => setCount((previous) => previous + 1)}>{count}</button>;
}

Continue with the quick start. If you are contributing to the project or want to run its examples locally, see Development and examples.

On this page