restaurants
restaurants copied to clipboard
Is willTransitionTo the best place to fetch client and server data?
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!
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 :-)
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.