markdalgleish / redial

Universal data fetching and route lifecycle management for React etc.
1.1k stars 42 forks source link

How does redial handle redirects triggered with a decorated component? #50

Open Aryk opened 7 years ago

Aryk commented 7 years ago

@markdalgleish - Is it possible to use redial when the top level components are decorated with for example an authentication check?

It seems like if a route gets matched, redial is designed to trigger and run the callbacks even if the authenticated check will fail and the user would get redirected somewhere else. Is that right?

I suppose this is what issues #38 and #47 are pertaining to.

If you were able to decorate the components further down, then perhaps they would only get their fetches triggered when those components were indeed rendered.

Is that right or am I missing something? That would make it very difficult to use this library if you were hiding/showing components further down that depended on different data that needed fetching.