├── .gitignore └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # (つ ° ヮ °)つ Understanding React Context 2 | 3 | A repo containing different ways to manage state in React with simple examples. 4 | 5 | ## How to use this repo 6 | 7 | You've heard about the [Context API](https://reactjs.org/docs/context.html). You're ready to start using it. Here's a friendly step-by-step progression to using context to manage some portion of your state in your production app. 8 | 9 | Each flavor of state management is under a separate branch: 10 | 11 | 1. [Component State (setState)](https://github.com/matthamil/react-context/tree/1-component-state) 12 | 1. [Redux](https://github.com/matthamil/react-context/tree/2-redux-state) 13 | 1. [Context](https://github.com/matthamil/react-context/tree/3-context) 14 | 1. [Nested Context](https://github.com/matthamil/react-context/tree/4-nested-context) 15 | 1. [Unstated](https://github.com/matthamil/react-context/tree/5-unstated) _(this is awesome :sparkles:)_ 16 | 17 | Checkout each branch one-by-one and run `yarn run start` (or `npm run start`) to see the app in action. 18 | 19 | :warning: This repo is not an endorsement of using context for all of your state management problems. Obligatory Tweet from Dan Abramov: 20 | 21 |
22 |
23 |