decord/source/1573_useFocusEffect.js

59 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1573
// Function ID: 1574
2026-07-20 16:05:17 +00:00
// Name: useFocusEffect
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 1543]
2026-08-06 08:05:19 +00:00
// Exports: useFocusEffect
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 1573 (useFocusEffect)
2026-08-24 06:08:38 +00:00
import closure_2 from "noop" /* 19 */;
2026-07-20 16:05:17 +00:00
2026-08-06 08:05:19 +00:00
const require = arg1;
2026-07-21 22:01:30 +00:00
2026-08-24 06:08:38 +00:00
export const useFocusEffect = function useFocusEffect(closure_2) {
const _require = closure_2;
2026-08-06 08:05:19 +00:00
navigation = _require(navigation[1]).useNavigation();
2026-07-20 16:05:17 +00:00
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-08-24 06:08:38 +00:00
const items = [closure_2, navigation];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
navigation = false;
2026-08-06 08:05:19 +00:00
if (navigation.isFocused()) {
2026-08-24 06:08:38 +00:00
const tmp2 = callback();
2026-07-29 08:29:29 +00:00
if (undefined === tmp2) {
let tmp3 = tmp2;
}
2026-08-24 06:08:38 +00:00
callback = tmp3;
2026-08-06 08:05:19 +00:00
navigation = true;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_2 = obj.addListener("focus", () => {
2026-07-23 10:11:24 +00:00
if (!c1) {
2026-08-24 06:08:38 +00:00
if (undefined !== callback) {
callback();
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp3 = callback();
2026-07-29 08:29:29 +00:00
if (undefined === tmp3) {
const tmp4 = tmp3;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
callback = tmp4;
2026-07-23 10:11:24 +00:00
c1 = true;
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
closure_3 = obj.addListener("blur", () => {
if (undefined !== callback) {
callback();
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
callback = undefined;
c1 = false;
2026-07-20 16:05:17 +00:00
});
return () => {
2026-08-24 06:08:38 +00:00
if (undefined !== callback) {
callback();
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
callback2();
callback3();
2026-07-20 16:05:17 +00:00
};
}, items);
};