Just wrap your app within a context provider and feed that provider with the data you want to make global:
Read moreHow do I declare a global variable in Reactjs?
You can declare a global context variable in any of the parent components and this variable will be accessible across the component tree by this. context. varname .
Read moreWhat is global in react native?
The global scope in React Native is variable global . Such as global. foo = foo , then you can use global. foo anywhere. But do not abuse it!
Read moreHow do you set a state globally in react native?
Just wrap your app within a context provider and feed that provider with the data you want to make global:
Read moreHow do you create a React context?
There are four steps to using React context:
Read moreIs React context global?
Our 3 components are now able to access the global state without the hassle of setting up Redux or the tedious process of prop drilling.25 Oca 2021
Read more