We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6890f4f commit 89299e9Copy full SHA for 89299e9
src/act-compat.js
@@ -1,6 +1,12 @@
1
import React from 'react'
2
import ReactDOM from 'react-dom'
3
-import {act as reactAct} from 'react-dom/test-utils'
+
4
+let reactAct
5
+try {
6
+ reactAct = require('react-dom/test-utils').act
7
+} catch (error) {
8
+ // ignore, this is to support old versions of react
9
+}
10
11
// act is supported [email protected]
12
// so for versions that don't have act from test utils
0 commit comments