Context.Consumer

Context.Consumer

<MyContext.Consumer>
  {value => /* render something based on the context value */}
</MyContext.Consumer>

A React component that subscribes to context changes.

This lets you subscribe to a context within a function component.

Related concepts

Context.Consumer

Context.Consumer — Structure map

Clickable & Draggable!

Context.Consumer — Related pages: