decord/source/1621_useRoutePath.js

58 lines
1.5 KiB
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1621
// Function ID: 1622
2026-08-06 08:05:19 +00:00
// Name: useRoutePath
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 1600, 1503]
2026-08-06 08:05:19 +00:00
// Exports: useRoutePath
2026-08-15 05:55:55 +00:00
// Module 1621 (useRoutePath)
2026-08-24 06:08:38 +00:00
import closure_2 from "noop" /* 19 */;
2026-08-06 08:05:19 +00:00
const require = arg1;
export const useRoutePath = function useRoutePath() {
options = getPathFromState.useContext(options(stateForPath[1]).LinkingContext).options;
stateForPath = options(stateForPath[2]).useStateForPath();
if (undefined === stateForPath) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Couldn't find a state for the route object. Is your component inside a screen in a navigator?");
2026-08-06 08:05:19 +00:00
throw error;
} else {
getPathFromState = undefined;
if (options != null) {
getPathFromState = options.getPathFromState;
}
if (getPathFromState == null) {
getPathFromState = tmp(tmp2[2]).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 = getPathFromState;
const obj2 = options(stateForPath[2]);
tmp = options;
tmp2 = stateForPath;
};