We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0566eb + 0dbb29c commit 436fe6dCopy full SHA for 436fe6d
src/test-utils.ts
@@ -1,7 +1,13 @@
1
-import { act } from "react";
+import * as React from "react";
2
+import * as DeprecatedReactTestUtils from "react-dom/test-utils";
3
+
4
declare global {
5
var IS_REACT_ACT_ENVIRONMENT: boolean;
6
}
7
8
+const act =
9
+ typeof React.act === "function" ? React.act : DeprecatedReactTestUtils.act;
10
11
type Item = {
12
callback: IntersectionObserverCallback;
13
elements: Set<Element>;
0 commit comments