-
Notifications
You must be signed in to change notification settings - Fork 62
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
Document the "multiple componentWillMount" behaviour #22
Comments
Yeah, a difficult one to manage. Ideally I would love to be able to skip the I have another library Sorry, not looking for self promotion, but it's the only solution I know of thus far if you are wanting to do full server side rendering. Full server side rendering is a pain. If SEO isn't absolutely critical to you my recommended approach is to use async components with the |
Could you use |
Hey, thanks for your work on this.
I use
componentWillMount
to kick off someredux-thunk
s that do data fetching for my component on the server side.Since
react-async-component
walks the tree to find the async components, it triggers all of thecomponentWillMount
calls...then I still have to render the resultingappWithAsyncComponents
withreact-dom
that invokes all of thosecomponentWillMount
s again.The result is that I end up hitting my API twice for everything...once while finding the async components, and once when actually rendering to string.
UPDATE: I also find when using
react-resolver
that the same occurs. Essentially, any data fetching / expensive activity that's triggered by a pass over the tree would have to happen twice with this sort of approach.The text was updated successfully, but these errors were encountered: