Files
react-navigation/packages/core/src/getChildRouter.ts
Brent Vatne 9a54742407 Merge pull request #21 from react-navigation/typescript
Add back TypeScript support
2018-11-27 02:29:12 +07:00

10 lines
278 B
TypeScript

export default function getChildRouter(router: any, routeName: string) {
if (router.childRouters && router.childRouters[routeName]) {
return router.childRouters[routeName];
}
const Component = router.getComponentForRouteName(routeName);
return Component.router;
}