What is a React checksum and how to use it?

I am reading this example of server side rendering by React. It states:

Try viewing the page source to ensure that the HTML message is sent from the server (using checksums to determine if client-side rendering is necessary)

Ok, I saw the source of the page and there really is an attribute data-react-checksum:

<div data-reactid=".157rq30hudc" data-react-checksum="556954499">

And when I check the item in the browser console, it also has an attribute:

enter image description here

Then I decided to check out my site, which also uses React server-side rendering. And I see a strange thing. The page source has an attribute data-react-checksum, but the element is not a console.

Page Source:

<div class="activityOptionBox" data-reactid=".1l6uko4wt8g" data-react-checksum="168103090">

Console:

enter image description here

What does it mean? What for checksumand how to read / use it?

+4
1

React ReactDOM.renderToString, , . , React DOM . , , , React .

, , - , React - , , .

, , React , , .

+14

Source: https://habr.com/ru/post/1620336/


All Articles