React TL;DR – a human filter for most useful React content.

All posts

Context – React

Context provides a way to pass data through the component tree without having to pass props down manually at every level.

 

  • Context is designed to share data that can be considered “global” for a tree of React components, such as the current authenticated user, theme, or preferred language.
  • Using context, we can avoid passing props through intermediate elements
  • If you only want to avoid passing some props through many levels, component composition is often a simpler solution than context.