Skip to content

Commit 6fb6fb1

Browse files
committed
also wrap asyncWrapper
1 parent b086f98 commit 6fb6fb1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/useWithoutAct.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export function userEventWithoutAct(
1818
async function wrapped(this: any, ...args: any[]) {
1919
const config = getConfig()
2020
// eslint-disable-next-line @typescript-eslint/unbound-method
21-
const orig = config.eventWrapper
21+
const eventWrapper = config.eventWrapper
22+
// eslint-disable-next-line @typescript-eslint/unbound-method
23+
const asyncWrapper = config.asyncWrapper
2224
try {
2325
config.eventWrapper = cb => cb()
2426
// eslint-disable-next-line @typescript-eslint/return-await
2527
return await (value as Function).apply(this, args)
2628
} finally {
27-
config.eventWrapper = orig
29+
config.asyncWrapper = asyncWrapper
30+
config.eventWrapper = eventWrapper
2831
}
2932
},
3033
]

0 commit comments

Comments
 (0)