UNPKG

889 BTypeScriptView Raw
1import * as React from 'react';
2import { Text, TextProps, GestureResponderEvent } from 'react-native';
3import type { NavigationAction } from '@react-navigation/core';
4declare type Props = {
5 to: string;
6 action?: NavigationAction;
7 target?: string;
8 onPress?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void;
9} & (TextProps & {
10 children: React.ReactNode;
11});
12/**
13 * Component to render link to another screen using a path.
14 * Uses an anchor tag on the web.
15 *
16 * @param props.to Absolute path to screen (e.g. `/feeds/hot`).
17 * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
18 * @param props.children Child elements to render the content.
19 */
20export default function Link({ to, action, ...rest }: Props): React.CElement<TextProps, Text>;
21export {};