https://github.com/angelfire/context-redux
React Context comparison
https://github.com/angelfire/context-redux
Last synced: about 1 month ago
JSON representation
React Context comparison
- Host: GitHub
- URL: https://github.com/angelfire/context-redux
- Owner: Angelfire
- Created: 2018-11-15T15:59:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-16T15:14:10.000Z (over 7 years ago)
- Last Synced: 2025-03-20T23:14:20.736Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 163 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Available Branches
### Plain React
We need to store the user’s info high enough in the tree that it can be passed down to the components that need it. In this case, the keeper of user info has to be `App`.
### Children Pattern
Here’s a version of the React example where Nav, Body, and Sidebar accept children and render them as-is. This way, the user of the component doesn’t need to worry about passing down specific pieces of data that the component needs – the user can simply render what it needs to, in place, using the data it already has in scope. This example also shows how to use any prop to pass children.
### Context
React Context API
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
## Note
All the examples were taken from [Redux vs. The React Context API](https://daveceddia.com/context-api-vs-redux/).
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).