'Why use Context API when we can use a static variable?
I am getting start to study Context API of the React Native. I understand that the Context API is to solve the problem to send a lot of props in the parameters. It seems to me as a global variable. In this case, to use a static variable of a class in JS don't fix the problem of a variable global? Why use Context API when we can use a static variable? What are better in Context API? Are others API that use Context API in React Native as pre-requisite?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|