mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-13 22:30:41 +08:00
19 lines
342 B
TypeScript
19 lines
342 B
TypeScript
import { TabActions, TabActionType } from '@react-navigation/routers';
|
|
|
|
export function jumpTo({
|
|
routeName,
|
|
key,
|
|
}: {
|
|
routeName: string;
|
|
key?: string;
|
|
}): TabActionType {
|
|
if (key === undefined) {
|
|
return TabActions.jumpTo(routeName);
|
|
} else {
|
|
return {
|
|
...TabActions.jumpTo(routeName),
|
|
target: key,
|
|
};
|
|
}
|
|
}
|