-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render called twice on server #76
Comments
That's correct. Because React doesn't support async rendering, we have to make multiple passes through the component tree until all promises have resolved on the server. There are a couple ways to try & solve this (#57 for example), but they're all pretty complex and will be resolved at a later date. |
I might lack of a more advanced understanding of react itself right here; |
I think @jachenry's question was why rendering happened twice (it can actually happen many more times, depending on the depth of the tree) on the server. As for the client, by itself, Resolver will render on the client progressively the same way a normal SPA would. There just happens to be a couple ways to:
Either way, until #57 happens and server-side rendering can pick up mid-tree, the multi-pass approach is the cleanest way of accomplishing this. Again, it should not be a problem for the application as React intends for the whole tree to be re-renderable at any point in time. |
My bad I'm sorry; I should not have pointed this one out on the other post. I was concerned about #75 (links breaks, the solution provided is what I just described right here) |
I've been noticing an issue where the componentWillMount/render methods inside my root component get called twice when rendering on the server. Attached below are some code snippets from the important parts.
Routes.js
server.js
Main.js
logs
Is anyone else seeing this issue? The issue goes away when I remove the react-resolver from the equation.
The text was updated successfully, but these errors were encountered: