Answer the question
In order to leave comments, you need to log in
Text variables in React.JS?
Hello.
For the first time I'm making a small one-page on react. There is a need to create variables containing text for the site. The question is how to do it correctly in order to have one file with all variables and then forward them to all components.
I understand that you need to create a file with a function that returns an object with these variables and then import this file into app.js from which we forward these variables to the remaining components.
I ask for help
Answer the question
In order to leave comments, you need to log in
Ideally, for such situations, they usually use, for example, Redux or MobX , these are tools for organizing application data storage, read the documentation (there is a Russian translation for Redux ).
As an option, create react.context and pass the necessary data through it.
Read the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question