useLinkTo

Used to create props that can be passed to a React Native or web component for creating a custom link.

Accepts a single argument of type:

type LinkToProps = {
href: Href;
replace?: boolean
}

Note that Href is a string that is typed based on your file system routes.

Returns an object of type:

type LinkToResult = {
href: string
role: 'link'
onPress: (event: e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent) => void
}

Edit this page on GitHub.