Skip to content
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

client bootstrapping json does not work correctly if page has multiple async components #44

Open
bishtawi opened this issue Apr 8, 2015 · 2 comments

Comments

@bishtawi
Copy link

bishtawi commented Apr 8, 2015

I am rendering a component on the server. This component has three child components. Each of these child components call getInitialStateAsync. When the page is loaded on the browser, it looks like react async is trying to boostrap first child component with the json that was dumped by the server. However, the json that its attempting to load is from the third child component.

It looks like we can only safely call getInitialStateAsync once on the server. Calling it multiple times overrides the previous json dump. So in my case, each of the child components call getInitialStateAsync and their json dumps override the previous dump. So on the client, react-async is attempting to bootstrap the first child component with the third's json data. The remaining two child components do not get bootstrapped at all.

@andreypopp
Copy link
Owner

This is because of #43, fixed in master (unreleased yet) but at the same time it has a different yet unstable API. Working to get this released by the end of the week.

@jpsfs
Copy link

jpsfs commented May 1, 2015

@andreypopp Hi!

Any updates on this issue?
Just tested with the version present on Master and gets the same behaviour that @bishtawi described.

Are you are near a solution or should I start thinking about making a fix myself?

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants