decord/source/9156_useInvalidPreventRemoveError.js

36 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 9156
// Function ID: 71637
2026-07-23 10:11:24 +00:00
// Name: useInvalidPreventRemoveError
// Dependencies: [57, 31]
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 9156 (useInvalidPreventRemoveError)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import result from "result";
export default function useInvalidPreventRemoveError(routes) {
const setNextDismissedKey = first(React.useState(null), 2);
first = setNextDismissedKey[0];
let tmp3 = null;
if (first) {
routes = routes.routes;
const found = routes.find((key) => key.key === first);
let name;
if (null != found) {
name = found.name;
}
tmp3 = name;
}
React = tmp3;
const items = [tmp3];
const effect = React.useEffect(() => {
if (result) {
const _HermesInternal = HermesInternal;
const _console = console;
console.error("The screen '" + result + "' 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.");
}
}, items);
return { setNextDismissedKey: setNextDismissedKey[1] };
};