decord/source/1531_useFocusEffect.js

59 lines
1.5 KiB
JavaScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1531
// Function ID: 1532
2026-07-20 16:05:17 +00:00
// Name: useFocusEffect
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 1532]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
// Module 1531 (useFocusEffect)
import noop from "noop";
2026-07-20 16:05:17 +00:00
2026-07-21 22:01:30 +00:00
2026-07-23 10:11:24 +00:00
export default function useFocusEffect(c5) {
const importDefault = c5;
2026-07-29 08:29:29 +00:00
let tmp = importDefault(1532)();
2026-07-20 16:05:17 +00:00
const dependencyMap = tmp;
if (undefined !== arguments[1]) {
const _console = console;
console.error("You passed a second argument to 'useFocusEffect', but it only accepts one argument. If you want to pass a dependency array, you can use 'React.useCallback':\n\nuseFocusEffect(\n React.useCallback(() => {\n // Your code here\n }, [depA, depB])\n);\n\nSee usage guide: https://reactnavigation.org/docs/use-focus-effect");
}
2026-07-23 10:11:24 +00:00
const items = [c5, tmp];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
let tmp = false;
if (tmp.isFocused()) {
2026-07-29 08:29:29 +00:00
tmp = c5;
const tmp2 = c5();
if (undefined === tmp2) {
let tmp3 = tmp2;
}
c5 = tmp3;
2026-07-20 16:05:17 +00:00
tmp = true;
}
2026-07-29 08:29:29 +00:00
let noop = obj.addListener("focus", () => {
2026-07-23 10:11:24 +00:00
if (!c1) {
2026-07-29 08:29:29 +00:00
if (undefined !== tmp3) {
tmp3();
}
tmp3 = tmp3();
if (undefined === tmp3) {
const tmp4 = tmp3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp4;
2026-07-23 10:11:24 +00:00
c1 = true;
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
let closure_3 = obj.addListener("blur", () => {
if (undefined !== tmp3) {
tmp3();
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = false;
2026-07-20 16:05:17 +00:00
});
return () => {
2026-07-29 08:29:29 +00:00
if (undefined !== tmp3) {
tmp3();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback();
tmp3 = callback2();
2026-07-20 16:05:17 +00:00
};
}, items);
};