Can be used to handle when a link cannot be opened
example
Create a toast
```ts
import { Link } from '@ef-carbon/react-native-dom';
import { Url } from '@ef-carbon/primitive';
Link.badUrl = function(url: Url, { message }: Error): void {
createToast(`Failed to open '${url}': ${message}`);
}
```
Type declaration
(url: Url, error: Error): void
Parameters
url: Url
error: Error
Returns void
Handler
Handler:function
The link handler. Will be invoked if a link is pressed in the application that matches the regular expression. The
matches in the regular expression will be passed to the handler
example
Simple Handler
```ts
import { Url } from '@ef-carbon/primitive';
import { Link } from '@ef-carbon/react-native-dom';
function handler(url: Url, path: string) {
console.log(url, path);
}
Link.handlers.set(/^ui:\/\/handler\/.*$/, handler)
```
Can be used to handle when a link cannot be opened