TypeScript and React: Context

TypeScript and React: Context

React’s context API allows you to share data on a global level. To use it, you need two things:

With React’s typings, context works without you doing anything else. Everything is done using type inference and generics. You consume all the implied type information which @types/react produces for you.

[…]