OneScript

NavigationLink

Push a value onto the enclosing NavigationStack.

NavigationLink appends value to the path of the enclosing NavigationStack when tapped. It renders as a native Button, so buttonStyle and other modifiers apply.

import { NavigationLink, NavigationStack, Text } from "onescript/views"

<NavigationStack destination={(id: number) => <Text>Order #{id}</Text>}>
  <NavigationLink value={1024}>View order #1024</NavigationLink>
</NavigationStack>
PropTypeDescription
valuestring | numberThe value appended to the path.
childrenViewChildThe link label.

NavigationLink works on the root page, on pushed pages, and inside toolbars. Using it outside a NavigationStack throws an error.

How is this guide?

Last updated on