I understand friend ... I have a doubt ... how are global variables handled in Reactjs ?? that is ... if I want to save and be able to use the variable == >> const name = '' in ALL my application; that variable will take a value when the user enters the system ... and from another component I want to use it ... that is, I want to get the value of that variable name ... can you help me?
You can store that variable in state and pass it as props to whatever component you need it(you'll need to read more on passing props) React official documentation is the best place to start.
Moreover, you'll reach a stage where passing this supposed variable from one component to another will be a pain in the ass, then you should use a state management, the popular one is redux. You'll need to go learn redux too. But for now, since you're just starting to learn react, try learning how to pass state as a props from one component to another.
Let me know if you need more clarification.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I understand friend ... I have a doubt ... how are global variables handled in Reactjs ?? that is ... if I want to save and be able to use the variable == >> const name = '' in ALL my application; that variable will take a value when the user enters the system ... and from another component I want to use it ... that is, I want to get the value of that variable name ... can you help me?
You can store that variable in state and pass it as props to whatever component you need it(you'll need to read more on passing props) React official documentation is the best place to start.
Moreover, you'll reach a stage where passing this supposed variable from one component to another will be a pain in the ass, then you should use a state management, the popular one is redux. You'll need to go learn redux too. But for now, since you're just starting to learn react, try learning how to pass state as a props from one component to another.
Let me know if you need more clarification.