Files
2026-05-27 23:47:53 +01:00

12 lines
455 B
TypeScript

// 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;
}