The message to display to the user or a function that returns either a message to display or a boolean indicating
whether the location change should be allowed. If message is a function and returns a boolean, no user
confirmation is rendered. If true is returned the location change proceeds as usual (as if no
<NavigationPrompt> were rendered at all). If false is returned, the navigation is blocked.
Optionalwhen
when?:boolean
Controls whether the prompt should be displayed (equivalent to conditionally rendering the <NavigationPrompt>).
The message to display to the user or a function that returns either a message to display or a boolean indicating whether the location change should be allowed. If
messageis a function and returns a boolean, no user confirmation is rendered. Iftrueis returned the location change proceeds as usual (as if no<NavigationPrompt>were rendered at all). Iffalseis returned, the navigation is blocked.