Answer the question
In order to leave comments, you need to log in
Am I understanding how React + Node.js works correctly?
Hey! I recently learned React.js (well, as I learned, I figured out the basics, I can do something not very complicated). Now I understand that BackEnd is needed. I looked closely at Node (JS I already know, plus the demand for it has increased recently). I started watching courses on the Internet + docks, etc. Template engines like ejs and others are very often mentioned there. Then I had a question: why do we need template engines, if React does a good job with this? Do I understand correctly that when linking Node + React, you need to send fetch (or XHR) requests to Node from React and then render the received data through React? And when receiving data from the user from React, send it to the server and Node processes it there?
Answer the question
In order to leave comments, you need to log in
You are right, but not quite. There is such a thing as SEO and indexing in search engines, and all this is not very friendly with SPA, so you often need to give honest html on the first request, and then "revive" with react. In general, I recommend studying the topic of hydration , ReactDOMServer and the general principles of SSR and the so-called. isomorphic applications
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question