decord/source/9113_useInvalidPreventRemoveError.js

36 lines
1.3 KiB
JavaScript
Raw Normal View History

2026-07-21 06:55:02 +00:00
// Module ID: 9113
2026-07-22 07:54:56 +00:00
// Function ID: 71387
2026-07-20 16:05:17 +00:00
// Name: useInvalidPreventRemoveError
// Dependencies: []
// Exports: default
2026-07-21 06:55:02 +00:00
// Module 9113 (useInvalidPreventRemoveError)
2026-07-22 07:54:56 +00:00
let closure_0 = importDefault(dependencyMap[0]);
let closure_1 = importAll(dependencyMap[1]);
2026-07-20 16:05:17 +00:00
2026-07-22 07:54:56 +00:00
export default function useInvalidPreventRemoveError(routes) {
const setNextDismissedKey = callback(React.useState(null), 2);
const first = setNextDismissedKey[0];
const callback = first;
let tmp3 = null;
if (first) {
routes = routes.routes;
const found = routes.find((key) => key.key === first);
let name;
if (null != found) {
name = found.name;
2026-07-20 16:05:17 +00:00
}
2026-07-22 07:54:56 +00:00
tmp3 = name;
2026-07-20 16:05:17 +00:00
}
2026-07-22 07:54:56 +00:00
const React = tmp3;
const items = [tmp3];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-07-22 07:54:56 +00:00
if (tmp3) {
const _HermesInternal = HermesInternal;
const _console = console;
console.error("The screen '" + tmp3 + "' was removed natively but didn't get removed from JS state. This can happen if the action was prevented in a 'beforeRemove' listener, which is not fully supported in native-stack.\n\nConsider using a 'usePreventRemove' hook with 'headerBackButtonMenuEnabled: false' to prevent users from natively going back multiple screens.");
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-22 07:54:56 +00:00
return { setNextDismissedKey: setNextDismissedKey[1] };
2026-07-20 16:05:17 +00:00
};