Answer the question
In order to leave comments, you need to log in
How to pass data from ExpressJS to ReactJS?
There is an app with back end on express and front end on react. Conventionally, the essence of the application is to receive weather data for the current day. The application will be without a database. And so, how to pass a variable or any other information in general from express to react, so that later this information could be displayed in a regular html tag?
Answer the question
In order to leave comments, you need to log in
Make a route for api. In this route, pass the necessary information. From React, access this route via axios/xhr/fetch, get the data, display it on the screen.
I did such a thing a couple of years ago, however, I used vuejs for the front (but it doesn’t matter).
Here is the proxy server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question