next.js icon indicating copy to clipboard operation
next.js copied to clipboard

blocking behavior and routes

Open andrew--grant opened this issue 9 years ago • 3 comments

Not sure this is an issue as such, possibly ignorance.

I understand that the getInitialProps will block while I await data from a remote server, but I’m not sure how NextJS recommends I handle the side effect of this when clicking on route links. So, when I click on the route link for ‘/about’ there is a noticeable delay while the data is fetched, so it appears to the end user like clicking on the aforementioned link was ineffective/non-responsive for some period.

I understand why this is happening, but this (among a couple of other things) is making me wonder what value NextJS is adding over, say, a create-react-app and redux solution? Or if I’m missing something here w/r to appropriate use cases for NextJS?

andrew--grant avatar Dec 20 '16 05:12 andrew--grant

In master we now have prefetch so browsers with service workers can download the next pages in the background and that delay will be gone.

We also have https://github.com/zeit/next.js/pull/250 so eventually we'll have a indicator of progress :)

FrancosLab avatar Dec 20 '16 07:12 FrancosLab

@FrancosLab is right. We have some stuff in the pipeline and will come with 2.0 release.

arunoda avatar Dec 20 '16 07:12 arunoda

Thank you, appreciate the speedy response!

andrew--grant avatar Dec 20 '16 08:12 andrew--grant