Skip to content

Commit c1f2957

Browse files
authored
fix: Ensure act is not any when React.act is not declared (#1323)
1 parent b6e59f7 commit c1f2957

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

types/index.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export function cleanup(): void
251251
* If that's not available (older version of react) then it
252252
* simply calls the deprecated version which is ReactTestUtils.act(cb)
253253
*/
254-
export const act: typeof reactAct extends never
254+
// IfAny<typeof reactAct, reactDeprecatedAct, reactAct> from https://stackoverflow.com/a/61626123/3406963
255+
export const act: 0 extends 1 & typeof reactAct
255256
? typeof reactDeprecatedAct
256257
: typeof reactAct

0 commit comments

Comments
 (0)