remix-run / history

Manage session history with JavaScript
MIT License
8.29k stars 961 forks source link

doing history.go() does NOT trigger a blocker callback handler #933

Open heath-freenome opened 2 years ago

heath-freenome commented 2 years ago

In order to properly implement the blocking capabilities in react-router 6 go needs to also do the same allowTx() processing as the other two actions. This is necessary because it may be important for an app to not to allow the browser navigation to move forward/backward based on some internal condition

It is also possible that the handlePop code isn't recognizing the registered blockers. Since doing navigate.go() using RR6 with with a custom blocker doesn't trigger the block handler... see this comment in RR6 issue for details. Or perhaps the go() code is not officially triggering the handlePop callback?

chenzewang commented 1 year ago

i got same question , likely: https://github.com/remix-run/react-router/issues/5383