1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = handleServerRequest;
|
7 |
|
8 | var _core = require('@react-navigation/core');
|
9 |
|
10 | function handleServerRequest(Router, pathWithLeadingSlash, query) {
|
11 | var path = pathWithLeadingSlash.slice(1);
|
12 |
|
13 |
|
14 | var navigationAction = Router.getActionForPathAndParams(path, query) || _core.NavigationActions.init();
|
15 |
|
16 |
|
17 | var navigationState = Router.getStateForAction(navigationAction);
|
18 |
|
19 | var actionSubscribers = new Set();
|
20 | var navigation = (0, _core.getNavigation)(Router, navigationState, function () {}, actionSubscribers, function () {
|
21 | return {};
|
22 | }, function () {
|
23 | return navigation;
|
24 | });
|
25 |
|
26 | var activeKey = navigationState.routes[navigationState.index].key;
|
27 | var activeChildNavigation = navigation.getChildNavigation(activeKey);
|
28 | var options = Router.getScreenOptions(activeChildNavigation);
|
29 | var title = options.title || options.headerTitle;
|
30 |
|
31 | return { navigation: navigation, title: title };
|
32 | } |
\ | No newline at end of file |