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
Within the function, attempt to access args.currentLocation, args.nextLocation, or args.historyAction.
Trigger navigation to an external site or close the browser tab.
Expected Behavior
The BlockerFunction currently expects args to always be provided based on its typing, so developers naturally assume it will be available. However, args is only provided when navigating within the app. Typing args as potentially undefined would allow users to avoid type errors and handle cases where args may not be provided, such as when navigating to an external site or closing the tab.
Actual Behavior
When navigating to an external site or closing the tab, the args object in BlockerFunction is undefined, resulting in runtime errors if properties like currentLocation, nextLocation, or historyAction are accessed.
The text was updated successfully, but these errors were encountered:
What version of React Router are you using?
6.27.0
Steps to Reproduce
Expected Behavior
The BlockerFunction currently expects args to always be provided based on its typing, so developers naturally assume it will be available. However, args is only provided when navigating within the app. Typing args as potentially undefined would allow users to avoid type errors and handle cases where args may not be provided, such as when navigating to an external site or closing the tab.
Actual Behavior
When navigating to an external site or closing the tab, the args object in BlockerFunction is undefined, resulting in runtime errors if properties like currentLocation, nextLocation, or historyAction are accessed.
The text was updated successfully, but these errors were encountered: