Examples of various state management techniques in React
It covers the possible usage of the following methods for managing state in a React application:
- Ref
- Context
- State
- Flux (a la React release version)
- Redux
- Recoil
- MobX
It attempts to address the pros/cons of each, and what they should and should not be used for.
The sample application uses a very basic React Router to decide which implementation you want to see.
In src/pages
you can see the various examples, as well as in the index.
In src/components
you will find the various components that are referenced in each of the pages.
Nope! These are examples, not production code!
Yes: https://state-management-examples.web.app/
Run npm ci
to install dependencies, then npm run dev
to boot up a local server.