MCPcopy Create free account
hub / github.com/code100x/mobile-magic / ExternalLink

Function ExternalLink

expo-base-app/components/ExternalLink.tsx:8–24  ·  view source on GitHub ↗
({ href, ...rest }: Props)

Source from the content-addressed store, hash-verified

6type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: string };
7
8export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected