DEV Community

sunflowerseed
sunflowerseed

Posted on

Do we really use useContext() in React?

It was once said that we either just React and state, or React with Redux or MobX, and that we really don't use Context.

The reason was that any change in Context may cause every single component to be re-rendered, versus, if we use Redux, then the global store passes the value in as props, so that only the "affected" components get re-rendered.

Is that still the case with useContext() or Context API?

I read the React Hooks docs and it said that the 3 most used Hooks are useState, useEffect, and useContext, so it kind of get me puzzled that I thought Context is rarely used.

Top comments (0)

ACI image

ACI.dev: Fully Open-source AI Agent Tool-Use Infra (Composio Alternative)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Check out our GitHub!