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

Context API vs Props Drilling

When should you use Context API instead of passing props (props drilling)?

Answer options

  • Always - Context API is faster than props
  • When data needs to reach many components at different levels of the tree, and intermediate components don't need it
  • Only when using TypeScript in the project
  • Never - props are always a better solution than Context

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