solid-router
solid-router copied to clipboard
Undetected location state changes while using browser back/forward buttons
Describe the bug
Navigation to the same route path with different state is detected using navigate(path, { state: ...}) directly — however when using browser back/forward buttons, the state changes are not detected until the page is refreshed.
Your Example Website or App
https://stackblitz.com/edit/solid-router-back-forward-undetected-state-change
Steps to Reproduce the Bug or Issue
- Navigate to the StackBlitz repro link
- Wait for the installation to finish and the dev server to start
-
Important Open the preview in a new tab
Open in New Tab - Initial state should be
null - Click on
Go to about with active truebutton - You'll see the page updating to
/aboutand the state is{"active": true} - Click on the browser
backbutton - You'll see the home page
/and the state isnull - Click on
Go to home with active falsebutton - You'll see the home page
/and the state is{"active":false} - Click on the browser
backbutton - You'll still see the home page
/and the state is{"active":false}the unexpected behavior - Refresh the page
- You'll see the home page
/and the state isnullexpected at 12. without refresh
Expected behavior
Same steps as above in the reproduction, starting from 11:
- Click on the browser
backbutton - See the home page
/and the state isnullwithout refreshing the page
Same with the browser forward button
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Brave - Chromium based
- Chromium Version:
114.0.5735.133 - Brave Version:
1.52.126
Additional context
No response