Which React feature can be combined with the Context API to optimize performance in components that consume context values?

  • React Fragments
  • React Hooks
  • React Portals
  • React Suspense
To optimize performance in components that consume context values, you can combine the Context API with React Hooks. Specifically, you can use the useContext hook to access context values. This hook allows you to consume context values without the need for a higher-order component, improving code readability and maintainability. React Portals, React Fragments, and React Suspense are not typically used for optimizing context consumption performance.
Add your answer
Loading...

Leave a comment

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