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
Currently, this manifests as the following on page reload for me:
formactionbuttonblock.tsx:60 Uncaught TypeError: Cannot destructure property 'nextLocation' of 'undefined' as it is undefined.
at when (:3000/src/components/formactionbuttonblock.tsx:32:21)
at :3000/node_modules/.vite/deps/react-router-prompt.js?v=d73664e4:644:35
The text was updated successfully, but these errors were encountered:
I solved the problem by adding in use-prompt.ts
const location = useLocation();
const action = useNavigationType();
then I updated use callback lines
(typeof when === "boolean" && when) || (typeof when === "function" && when({ currentLocation: location as Location<any>, nextLocation: blocker.location as Location<any>, historyAction: action }))
Then it works.
Hmmm I had a similar issue. It looks like this issue is mostly when you navigate outside of your app. This also doesn't look like an issue from this package since BlockerFunction is a dependency in react-router.
As part of
6a1dc67a20c14c3d5952f8252519ada413c82eb6
the following change has been introduced:Calling
when
without any arguments is not compatible withCurrently, this manifests as the following on page reload for me:
The text was updated successfully, but these errors were encountered: