({ href, ...rest }: Props)
| 6 | type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: string }; |
| 7 | |
| 8 | export function ExternalLink({ href, ...rest }: Props) { |
| 9 | return ( |
| 10 | <Link |
| 11 | target="_blank" |
| 12 | {...rest} |
| 13 | href={href} |
| 14 | onPress={async (event) => { |
| 15 | if (Platform.OS !== 'web') { |
| 16 | // Prevent the default behavior of linking to the default browser on native. |
| 17 | event.preventDefault(); |
| 18 | // Open the link in an in-app browser. |
| 19 | await openBrowserAsync(href); |
| 20 | } |
| 21 | }} |
| 22 | /> |
| 23 | ); |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected