mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
Currently, to access the focused child screen, we need to do something like this: ```js const routeName = route.state ? route.state.routes[route.state.index].name : route.params?.screen || 'Feed'; ``` However, it doesn't handle some cases, such as when `route.state` is partial. This helper will make it easier: ```js const routeName = getFocusedRouteNameFromRoute(route) ?? 'Feed'; ```