I watched React manuals, one got the impression that when opening a page in a browser, not html should come from the server, but only data that React receives later and renders using jsx in html, and this should be done, it will not take too much resources on the client? Or is it still better to give the normal html page from the server as usual, and only then, as necessary, change the components on the client, as usual?
- if you want to use the reactor, you need to decide what it is for. It has a templating engine, so why render it here and there, share views on the server and on the client? Isn't it easier to use regular JS to show it on the page? Yes, rendering on the client uses resources, sometimes a lot (especially when used improperly). Well and the purpose of it to consist in Single Page Application. - tcpack4
- And if the site is multipage ... i. the user somehow goes through the url and the only question is how to give him this page in the form of html or in the form of data that will later be rendered through react, then how best? - vvtvvtvvt1
- it is better to communicate with the server through api and not to mix templates, otherwise problems may arise (besides increasing the complexity of the architecture). for example, how to hang double-sided binding or events in the server template and associate with the reactor? Only through crutches. But in general: the tool must be selected for the task, not to complicate the simple. The reaction is needed to build complex interfaces on the client. If you do not have this, then it is not needed. On the contrary, problems can bring: SEO, building front-end applications, etc. - tcpack4
- For optimization, you can use SSR and give the finished HTML, and there the reactor will pick up and will finish to draw as needed ... - xFloooo
|