ericclemmons / react-resolver

Async rendering & data-fetching for universal React applications.
https://ericclemmons.github.io/react-resolver
Other
1.65k stars 52 forks source link

Initial rendering #96

Closed khankuan closed 9 years ago

khankuan commented 9 years ago

Is there a way to turn of resolving totally. What happens is the react router was having empty route handlers because of the resolve. Resolving immediately doesn't work as well since it is executed after router is done. This causes universal rendering checksum to mismatch.

ericclemmons commented 9 years ago

I'm not sure what problem you're having without showing some code.

I render on the server & bootstrap on the client w/o checksum issues, including using React Router.

khankuan commented 9 years ago

Ah, i was returning Promise.resolve() instead of return.. thats probably the cause. Thanks!

khankuan commented 9 years ago

Hmm quick question: Is it possible to prevent resolve from running at initial render on client side? I might be able to do it by setting a window variable and checking it but that might not be so nice in code :P

ericclemmons commented 9 years ago

You can do a normal React.render(<Whatever />, mountNode) and skip the resolving part.

But, really, as long as the props are already set, resolver won't do squat :D

khankuan commented 9 years ago

Hmm odd, I tried that and had the same result as resolver

ericclemmons commented 9 years ago

Well, the @resolve decorators are still there. So either the data exists via props, or is in the resolver cache that you provide :)