https://github.com/leandroberlin/react-context
React’s ⚛️ new Context API example
https://github.com/leandroberlin/react-context
Last synced: 3 months ago
JSON representation
React’s ⚛️ new Context API example
- Host: GitHub
- URL: https://github.com/leandroberlin/react-context
- Owner: LeandroBerlin
- Created: 2018-03-07T20:21:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-07T20:31:10.000Z (about 7 years ago)
- Last Synced: 2025-01-19T10:09:00.084Z (5 months ago)
- Language: JavaScript
- Homepage: https://leodvg.github.io/React-Context/
- Size: 226 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React’s new Context API
Typically, data in a React application is passed top-down (parent to child) via props.
But sometimes it’s useful to pass values through multiple levels of abstraction
without involving each intermediate. Examples include a locale, or a UI theme.Context in React provides a mechanism for a child component to access a value in an ancestor component.
From now on we’ll refer to the ancestor as the provider and the child as the consumer.The example is using React 16.3 alpha - check the package.json for details