Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

behavior-probe-entry.ts

19 lines816 Bytes

1// Production bundles inline the unset flag, so Metro folds this away before collecting dependencies.
2// Only mobile:behavior's and mobile:metrics' Metro sets it, including mobile:metrics' release bundle.
3if (process.env.EXPO_PUBLIC_T3_BEHAVIOR_PROBE === "1") {
4 // A production bundle sets up no DevTools hook; React still reports commits to one it finds.
5 const global = globalThis as { __REACT_DEVTOOLS_GLOBAL_HOOK__?: object };
6 if (!__DEV__)
7 global.__REACT_DEVTOOLS_GLOBAL_HOOK__ ??= {
8 isDisabled: false,
9 supportsFiber: true,
10 renderers: new Map(),
11 inject: () => 1,
12 onScheduleFiberRoot: () => {},
13 onCommitFiberRoot: () => {},
14 onCommitFiberUnmount: () => {},
15 onPostCommitFiberRoot: () => {},
16 checkDCE: () => {},
17 };
18 require("./behavior-probe");