Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
// Module ID: 1604
|
|
// Function ID: 1605
|
|
// Dependencies: [19, 1583, 1486]
|
|
// Exports: useRoutePath
|
|
|
|
// Module 1604
|
|
import BaseNavigationContainer from "BaseNavigationContainer" /* 1486 */;
|
|
import get_options from "get options" /* 1583 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
require = arg1;
|
|
|
|
export const useRoutePath = function useRoutePath() {
|
|
const options = noop.useContext(get_options.LinkingContext).options;
|
|
const stateForPath = BaseNavigationContainer.useStateForPath();
|
|
if (undefined === stateForPath) {
|
|
const _Error = Error;
|
|
const error = new Error("Couldn't find a state for the route object. Is your component inside a screen in a navigator?");
|
|
throw error;
|
|
} else {
|
|
let getPathFromState;
|
|
if (options != null) {
|
|
getPathFromState = options.getPathFromState;
|
|
}
|
|
if (getPathFromState == null) {
|
|
getPathFromState = BaseNavigationContainer.getPathFromState;
|
|
}
|
|
let enabled;
|
|
if (options != null) {
|
|
enabled = options.enabled;
|
|
}
|
|
const items = [enabled, , , ];
|
|
let config;
|
|
if (options != null) {
|
|
config = options.config;
|
|
}
|
|
items[1] = config;
|
|
items[2] = stateForPath;
|
|
items[3] = getPathFromState;
|
|
return obj.useMemo(() => {
|
|
let enabled;
|
|
if (options != null) {
|
|
enabled = tmp.enabled;
|
|
}
|
|
if (false !== enabled) {
|
|
let config;
|
|
if (tmp != null) {
|
|
config = tmp.config;
|
|
}
|
|
return getPathFromState(stateForPath, config);
|
|
}
|
|
}, items);
|
|
}
|
|
obj = noop;
|
|
};
|