Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Example with slow getInitialProps #49

Open
Svish opened this issue Nov 13, 2019 · 2 comments
Open

Example with slow getInitialProps #49

Svish opened this issue Nov 13, 2019 · 2 comments

Comments

@Svish
Copy link

Svish commented Nov 13, 2019

I have a page where the getInitialProps is a bit slow. I tried to make it even slower, but the loading indicator still didn't show up. The delayed-enter example does work, but it doesn't do its "loading" in getInitialProps.

Would it be possible for someone here to add a working example of a loader showing up while getInitialProps is "loading" something (on the client of course)?

@nwalters512
Copy link
Member

Based on my understanding of Next, I don't think that's possible to make work. Next will wait for getInitialProps to complete before switching to the new page, so we can't actually detect the transition until the data finishes loading.

@Svish
Copy link
Author

Svish commented Nov 13, 2019

Wouldn't be possible to hook into router events either? https://github.com/zeit/next.js/blob/canary/examples/with-loading/pages/_app.js

My understanding of Next is pretty newb, so you're probably right, but yeah. 🤔

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants