No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

createRexStore

createRexStore: <T, V>(useRexState: (value?: V) => T) => ({
  RexProvider: (props: { children: ReactNode; value?: V }) => JSX.Element;
  useStore: () => T;
});

createRexStore accepts your hook as the argument and returns an object with two properties ﹣

  • RexProvider which is a "Provider" component that will let you pass your hook down the React component tree to all the components by storing it in React context.
  • useStore hook will fetch your hook from the React context into your current component. This is built on top of the react "useContext" hook.