Context API
↔ React API to fix Prop Drilling, share global data
Source: reactjs.org/docs/context.html
createContext()
Context API
fn to create Context
Object
Provider
Wrapper FC to provide Context
value
to all Subscribing children
Consumer
redundant WET way to access Context
- use useContext()
instead
Subscribe
to access Context
from closest Parent Provider
in Component Hierarchy
Context
Interface Object to share data to all Subscribing children
References
createContext()
↔Context API
fn to createContext
Object