-
Notifications
You must be signed in to change notification settings - Fork 30.2k
Closed
Description
Examples bug report
Example name
with-apollo
Describe the bug
Preloading data only works server side. When using client side routing the data from the tree is not preloaded which results in the page rendering before the data was loaded. Again this results in "flashing" / "jumping" of the content because we need to display a loading indicator.
To Reproduce
- Clone the with-apollo example and run it
- Go to the about page
- Navigate from about page to index page
- Loading indicator shows for a few milliseconds before showing actual loaded content
Expected behavior
I'd expect the same behavior for client side routing as for server side rendering or at least an opt-in option. History pushState should happen only after the data has been loaded from the subtree.
As the NextJS documentation states:
Client-side routing behaves exactly like the browser:
- The component is fetched.
- If it defines getInitialProps, data is fetched. If an error occurs, _error.js is rendered.
- After 1 and 2 complete, pushState is performed and the new component is rendered.
Metadata
Metadata
Assignees
Labels
No labels