Abstract the creation of a Context.Provider
and its useContext
hook.
It helps centralizing state logic which is shared across children.
With PNPM 👇
pnpm i @mlaopane/react-view-model
Or with NPM 👇
npm i @mlaopane/react-view-model
You can find an interactive example here : https://codesandbox.io/s/react-view-model-bundle-z6zv34