With regard to the React Context API, what does a “provider” do?
The Provider component accepts a value prop to be passed to consuming components that are descendants. Since any React component in a React Redux app can be connected to the store, most applications will render a <Provider> at the top level, with the entire app’s component tree inside of it.
With regard to the React Context API, how would we implement a “consumer” role?
All consumers that are descendants of a Provider will re-render whenever the Provider’s value prop changes. The propagation from Provider to its descendant consumers (including .contextType and useContext) is not subject to the shouldComponentUpdate method, so the consumer is updated even when an ancestor component skips an update.
Specifically with Context, how are we “wrapping” components to achieve our goals?
The wrapped component receives all the props of the container, along with a new prop, data , which it uses to render its output.