restaurants icon indicating copy to clipboard operation
restaurants copied to clipboard

Is willTransitionTo the best place to fetch client and server data?

Open esnunes opened this issue 9 years ago • 2 comments

At the moment I'm using react-router willTransitionTo static method to fetch data on both client and server sides. What do you think about it? +1? -1? Do you have a suggestion? Can you point out a use-case that can't be handled by this approach?

Thanks!

esnunes avatar Mar 28 '15 00:03 esnunes

I have ended up doing the same while contemplating what the "best practice" would be. Would be interesting to see some other approaches. Nice job making the example btw :-)

eiriklv avatar Mar 28 '15 15:03 eiriklv

I couldn't make willTransitionTo work using this approach. I would use willTransitionTo to check if user is loggedIn but never stop there. My sample https://github.com/alduro/flux-isomorphic-app/blob/master/app/shared/components/Restaurant.js

Maybe I'm missing something but was frustrating. Thanks in advance.

alduro avatar Jul 02 '15 14:07 alduro