mhart/react-server-example

safeStringify with react 16 hydrate

againksy opened this issue · 5 comments

safeStringify in react 16 hydrate produces errors like this
Warning: Text content did not match. Server: "</script>fasdfsfsf </script> " Client: "</script>fasdfsfsf </script>"

mhart commented

Can you show me how to reproduce this?

@mhart yes - as you see the function safeStringify it replaces some code. If i dont use this the render happens- but in browser- on client is just text string on whole page- something broken caused by maybe or something from some variables in my components( the variables just strings to display them as text).
and so on- in this way the hydrate method gives error- but react states that in react 17 we should use the hydrate instead of render

mhart commented

Can you show me some code to reproduce this?

yes, ill try but the example seems to be some complex, cant do it right now=(

mhart commented

Going to close this due to lack of activity – feel free to reopen if you have a reproduction.