Guides
Creating a Store

The store can be created using the create function.

import { create } from '@opentf/react-state';

Init

Pass an object to initialize the store.

const State = {};
const { useAppState, setAppState, api } = create(State);

It is recommended to create a store with the plain JS object.

💡

You can create multiple stores for your app.