What is the primary benefit of using the Context API in React?

  • Global state management.
  • Improved performance.
  • Reduced component re-rendering.
  • Simplified component hierarchy.
The primary benefit of using the Context API in React is global state management. Context API allows you to create a global state that can be accessed by multiple components, eliminating the need to pass props through multiple levels of components. While it may help reduce re-renders in some cases, its primary advantage is its ability to manage global state.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *