DEV Community

Discussion on: Getting Started with React useContext Hook and React Context

Collapse
 
alexdevero profile image
Alex Devero

This is useful when you want to expose multiple types of data inside your app. When you expose all data through one provider, every change of one piece of the data will cause all subscribed children to re-render to update the UI. When you have multiple providers, each provider will trigger re-render only for its subscribed children. So, change of one provider will not affect children that are not subscribed to that provider.