Initial Commit
This commit is contained in:
11
packages/threejs/r3f/r3f-networking/tests/setup/polyfills.ts
Normal file
11
packages/threejs/r3f/r3f-networking/tests/setup/polyfills.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
// React-specific polyfills. The base webcrypto polyfill loads via
|
||||
// `@suaveplan/testing/polyfills`. This sets the React 18+
|
||||
// `IS_REACT_ACT_ENVIRONMENT` flag so DOM assertions outside `act(...)`
|
||||
// don't generate runtime warnings.
|
||||
interface ReactActEnvWindow {
|
||||
IS_REACT_ACT_ENVIRONMENT?: boolean;
|
||||
}
|
||||
const win = globalThis as unknown as ReactActEnvWindow;
|
||||
if (win.IS_REACT_ACT_ENVIRONMENT === undefined) {
|
||||
win.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
}
|
||||
Reference in New Issue
Block a user