You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
Thank you for this awesome lib, really solves a lot of problem with SSR.
However, there is a little but very annoying trick. Assume I have walked through my application components tree, collected and upfilled all necessary data. When resolving a promise, in place where you wrote Now is a good time to call React's renderToString in example, I'm calling it and... see that renderToString starts to recreate all my components tree from the scratch. And it's okay if my data is stored in external storages, but those data that is inside the state is obviously being lost, because renderToString starts to call constructors again.
Can you, please, give me an advice, how to deal with this weird behaviour? Because I suppose that creating an external storage for every small view is not so good idea.
Thank you in advance and sorry for "stackoverflowing" in issues.
The text was updated successfully, but these errors were encountered:
limbosounds
changed the title
ReactDOMServer.renderToString() recreates components tree from the stratch
ReactDOMServer.renderToString() recreates components tree from the scratch
Oct 19, 2018
Hello!
Thank you for this awesome lib, really solves a lot of problem with SSR.
However, there is a little but very annoying trick. Assume I have walked through my application components tree, collected and upfilled all necessary data. When resolving a promise, in place where you wrote
Now is a good time to call React's renderToString
in example, I'm calling it and... see thatrenderToString
starts to recreate all my components tree from the scratch. And it's okay if my data is stored in external storages, but those data that is inside thestate
is obviously being lost, becauserenderToString
starts to call constructors again.Can you, please, give me an advice, how to deal with this weird behaviour? Because I suppose that creating an external storage for every small view is not so good idea.
Thank you in advance and sorry for "stackoverflowing" in issues.
The text was updated successfully, but these errors were encountered: