UNPKG

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