What is Context API? The React Context API is a way for a React app to effectively produce global variables that can be passed around . This is the alternative to “prop drilling” or moving props from grandparent to child to parent, and so on.
Read moreHow do I set a global state in React?
Just wrap your app within a context provider and feed that provider with the data you want to make global:
Read moreIs Context global state?
The Context API is here to solve some of those conundrums by: Centralizing a global application state : Instead of being limited to local states on views, you can now share data on one central component and spread to its inner components (children, grandchildren and so forth).
Read more