Skip to content

useSheetRouter ​

A hook that helps you navigate between routes inside the sheet. It returns a Router object.

ts
import {useSheetRouter} from 'react-native-actions-sheet';

const router = useSheetRouter();

currentRoute:Route ​

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

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 100false

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 100false

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.

Released under the MIT License.