Reference
useRouter

useRouter

A hook that helps you navigate between routes inside the sheet.

currentRoute:Route

The current navigation route in stack that has been navigated to.

navigate

Navigate to a route

Parameters:

name

Name of the route to navigate to.

TypeRequired
stringtrue

params:

Any data to pass to the route during navigation.

TypeRequired
anyfalse

snap:

Snap value for navigation animation. Between -100 to 100. A positive value snaps inwards, while a negative value snaps outwards.

TypeRequired
-100 to 100true

goBack

Navigate back from a route.

Parameters:

name

Name of the route to navigate to.

TypeRequired
stringfalse

snap:

Snap value for navigation animation. Between -100 to 100. A positive value snaps inwards, while a negative value snaps outwards.

TypeRequired
-100 to 100true

close()

Close the sheet

popToTop()

Pop to top of the stack

hasRoutes()

Check whether any routes have been registered with this sheet.

stack:Route[]

Get the current rendered stack.

canGoBack()

Check whether router can go back in navigation.

Last updated on February 13, 2023