When you want to move between a page, you have a few options. Examples on this page will reference this routing structure:
You can use the Link component as follows:
app/index.tsx
Link accepts the following props, where Href
is your typed file system routes (or a string if you turn off typed file system routing) and TextProps
is the React Native Text element props:
This hook will generate both an href
string and an onPress
function, see the useLinkTo docs for how to use it.
This hook returns a static object used for routing. It will never update, and is only used for imperatively controlling the router. Useful for programmatically controlling the routing, and choosing between a push
or replace
.
See the useRouter documentation page for more.
Edit this page on GitHub.