Question · JavaScript and React course · Module 4: Context API and useReducer

Splitting Contexts

What is the main solution to the problem of unnecessary re-renders in Context API?

Answer options

  • Using useCallback inside useContext
  • Splitting one large context into smaller, specialized contexts
  • Adding shouldComponentUpdate to every consumer
  • Disabling strict mode in React

You can check the correct answer by solving this task in the CodeWorlds game.