Closed NunoSempere closed 2 years ago
Oh. Looks like an issue with the way I used useEffect
, it reloaded data on initial render.
Fixed with the custom useNoInitialEffect.
I also threw in nprogress bar, hope you'll like it :)
Also, turns out I forgot to add shallow: true option to router.replace
call, which caused double fetching (Next.js refetches getServerSideProps on navigation by default). Fixed this one too.
Great, thanks!!
Behavior: On initial site load, the site flashes. That is, the content is briefly shown, then it disappears, and then it's shown again.
Desired behavior: That doesn't happen.
You can see a video of this behavior on: https://imgur.com/a/hN50EhG
Steps to reproduce: Load a page you haven't searched for before on an incognito tab on Chrome.