navigate() from function reference is causing full page refresh #30187
Unanswered
nickgrealy
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When calling
navigate()
from a function reference, it causes the page to fully reload.Steps to reproduce
Here is the minimum reproducible code, from the latest Gatsby version:
Versions:
Sample Project: https://github.com/nickgrealy/gatsby-navigate-bug/blob/main/src/pages/index.js
Sample Project Hosted: https://gatsby-navigate-bug.vercel.app/
Expected result
I expect the page should load using javascript (no full page reload should happen).
Actual result
The new page is fully reload - this is slow, and can be observed in the developer tools under "Network" tab.
Environment
Latest Gatsby
3.0.4
.Latest Chrome
88.0.4324.192
Node
v12.14.1
Beta Was this translation helpful? Give feedback.
All reactions