A callback that can be used to perform some work before navigating. It should
return true if navigation can continue afterwards or false if the navigation
attempt should be canceled.
Note: the function should be wrapped by a useCallback ot avoid unnecessary rendering cycles.
Returns boolean | Promise<boolean>
OptionalrestrictNavigation
restrictNavigation?:boolean
When set to true, each navigation attempt to an external URL will
result in a warning by the browser and every in-app navigation will trigger a
call to onNavigate().
A callback that can be used to perform some work before navigating. It should return
true
if navigation can continue afterwards orfalse
if the navigation attempt should be canceled.Note: the function should be wrapped by a
useCallback
ot avoid unnecessary rendering cycles.