Using navigate() function with a state change doesn't rerender the page
See original GitHub issueDescription
Calling the same page with a state change navigate('/page', { state: { newState }})
doesn’t cause the page to rerender.
Downgrading gatsby to version 2.24.69
fix the issue and the page is rerendered correctly.
Steps to reproduce
I’ve create a minimal reproduction that show the problem: https://github.com/doscio/gatsby-navigate-issue
The index page has a button that navigate to /counter
page. On that page, everytime the button Increase counter
is pressed,
the counter should increase it’s value, but this is not appening on gatsby version 2.24.85
.
Versions prior to 2.24.70
works without problem:
- Run
npm install gatsby@2.24.69
- Run
gatsby develop
Everytime I click Increase counter
the counter is updating correctly.
Expected result
Everytime the button Increase counter
is pressed the counter value should update it’s value.
Actual result
Nothing appens when i click the button Increase counter
.
If i refresh the page manually (F5) the counter show the correct value.
Environment
System:
OS: Windows Server 2016 10.0.14393
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Binaries:
Node: 14.4.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 3.9.0
Browsers: {}
npmPackages:
gatsby: ^2.24.85 => 2.24.85
npmGlobalPackages:
gatsby-cli: 2.12.109
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (4 by maintainers)
Top GitHub Comments
Hi @vladar & @doscio, Sorry for the slow response - happy to take a look into this one 😃.
Hi @vladar 👋 I have created a PR with a fix for this issue at https://github.com/gatsbyjs/gatsby/pull/28346 😃