Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit 00d11da

Browse files
jeffreyffsbcarroll22
authored andcommitted
fix(types): update type of act to support async act (#65)
1 parent 169dd88 commit 00d11da

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

typings/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ReactElement, ComponentType } from 'react';
2+
import { act as reactAct } from 'react-test-renderer';
23

34
import * as queries from './queries';
45
import * as queryHelpers from './query-helpers';
@@ -49,7 +50,9 @@ export function render<Q extends Queries>(
4950

5051
export const cleanup: () => void;
5152

52-
export const act: (callback: () => void) => void;
53+
export const act: typeof reactAct extends undefined
54+
? (callback: () => void) => void
55+
: typeof reactAct;
5356

5457
export { queries, queryHelpers, within };
5558
export * from './to-json';

0 commit comments

Comments
 (0)