4 ms·
> Context updates all components. All the components that consume it. Not the whole tree under the provider.
by omeid2 3y ago
> Context updates all components.
All the components that consume it. Not the whole tree under the provider.
- satvikpendem 3y agoIt is the whole tree, actually. That's one reason I don't use context.
- omeid2 3y agoThat is simply not true. Only via a Consumer or useContext hook do you subscribe to hooks. It is well documented and implemented like so. https://react.dev/reference/react/useContext https://react.dev/reference/react/useContext > useContext is a React Hook that lets you read and *subscribe* to context from your component. Emphasise mine.