K
K
kamelot432021-06-23 12:00:50
React
kamelot43, 2021-06-23 12:00:50

How to request data for dynamic roots in React on the server?

Colleagues, welcome) There is a React application (Create React App). You need to tighten it up - instead of client rendering, use server-side rendering (SSR). You need to request data on the server side, in particular data for meta tags. I found an article where SSR is described in detail https://www.digitalocean.com/community/tutorials/r... , but it is not clear how you can request data on the server for dynamic pages. (for example, for the product page product/some_product_id ). Can you please tell me where you can see an example of a data request for SSR, taking into account dynamic paths? how to solve the problem ? First of all, it is important to work properly with meta-data. (It is important to implement everything inside CRA . Switching to Next.js and other analogues is not relevant). Thanks in advance )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
ParaBellum577, 2021-06-23
@ParaBellum577

here it is described in detail in Russian how to do it https://www.digitalocean.com/community/tutorials/r...
create a template for the page with all the necessary markup, then pull the data from the server and substitute the data into this template

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question