How to declare a global variable in React?
If you need to declare a global variable in React, then you can do the following:
Create a file called config.js
Then import the config file where you need it:
|
|
Then where you need it in your code:
|
|
or
|
|