Type Signature
Parameters
Error | string
Optional error to be thrown by
abortNavigation. Can be an Error object or a string message.Return Value
Returnsfalse to abort the navigation.
Examples
Basic Usage
The example below shows how you can useabortNavigation in a route middleware to prevent unauthorized route access:
Using String Error Message
You can pass the error as a string:Using Error Object
You can pass the error as an Error object, e.g. caught by thecatch-block: