1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getFocusedRouteNameFromRoute;
|
7 |
|
8 | var _useRouteCache = require("./useRouteCache");
|
9 |
|
10 | function getFocusedRouteNameFromRoute(route) {
|
11 | var _route$CHILD_STATE, _state$index;
|
12 |
|
13 |
|
14 | const state = (_route$CHILD_STATE = route[_useRouteCache.CHILD_STATE]) !== null && _route$CHILD_STATE !== void 0 ? _route$CHILD_STATE : route.state;
|
15 | const params = route.params;
|
16 | const routeName = state ?
|
17 | state.routes[
|
18 |
|
19 | (_state$index = state.index) !== null && _state$index !== void 0 ? _state$index : typeof state.type === 'string' && state.type !== 'stack' ? 0 : state.routes.length - 1].name :
|
20 | typeof (params === null || params === void 0 ? void 0 : params.screen) === 'string' ? params.screen : undefined;
|
21 | return routeName;
|
22 | }
|
23 |
|
\ | No newline at end of file |