You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually problematic for apps that need to access history.state, especially when navigating through the browser's history. The problem is only present on the first load of the page, since that's the only time page.js automatically interacts with the history state. Indirect interaction through ctx.save() from within a route handler isn't really an issue since that would be intentional — and therefore, avoidable.
One way of mitigating this problem is to allow page.start() to accept an initial state. That way, if an app needs to retain the history state, history.state can be passed in as the initial state. The new page.start() function would look something like the following:
When page.js is started, it clears the
history.state
via the following line.page.js/index.js
Line 168 in 4f99916
This is actually problematic for apps that need to access
history.state
, especially when navigating through the browser's history. The problem is only present on the first load of the page, since that's the only time page.js automatically interacts with the history state. Indirect interaction throughctx.save()
from within a route handler isn't really an issue since that would be intentional — and therefore, avoidable.One way of mitigating this problem is to allow
page.start()
to accept an initial state. That way, if an app needs to retain the history state,history.state
can be passed in as the initial state. The newpage.start()
function would look something like the following:Which would allow you to do something like this:
I decided to open this issue, as a RFC, rather than submitted a PR, because I'd like some feedback on my proposal.
The text was updated successfully, but these errors were encountered: