H
H
hellcaster2020-09-19 11:38:33
Node.js
hellcaster, 2020-09-19 11:38:33

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

1 answer(s)
N
newx, 2020-09-20
@web_Developer_Victor

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 question

Ask a Question

731 491 924 answers to any question