You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the following snippet causes sub routes to never perform their fetch if you deep link directly to them.
// Don't fetch data for initial route, server has already done the work:
if (window.INITIAL_STATE) {
// Delete initial data so that subsequent data fetches can occur:
delete window.INITIAL_STATE
} else {
// Fetch mandatory data dependencies for 2nd route change onwards:
trigger('fetch', components, locals)
}
What if you are rendering a page that is partially server rendered but still needs to retrieve more data? For example, I load up my profile page directly instead of going to the home page first?
The above code works when going from the first page to the second page. But regardless will never fetch on the first page.
If this is intentional, can you explain why?
The text was updated successfully, but these errors were encountered:
I'm not sure I understand the question correctly @adriaanbalt , but react-router's match callback provides an object renderProps. However this renderProps object has a property components that only provides the top level components for the current Route, and their props. This is how redial triggers hooks - a lookup in this list of component. This makes it impossible for redial to trigger in deeply nested components (relative to the nearest react-routerRoute parent) See below the trigger source
It appears that the following snippet causes sub routes to never perform their fetch if you deep link directly to them.
What if you are rendering a page that is partially server rendered but still needs to retrieve more data? For example, I load up my profile page directly instead of going to the home page first?
The above code works when going from the first page to the second page. But regardless will never fetch on the first page.
If this is intentional, can you explain why?
The text was updated successfully, but these errors were encountered: