Skip to content

Commit 0c3ffaa

Browse files
committed
chore: feature check
1 parent 0deae3f commit 0c3ffaa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/fiber/src/core/utils.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ export type Act = <T = any>(cb: () => Promise<T>) => Promise<T>
3131
/**
3232
* Safely flush async effects when testing, simulating a legacy root.
3333
*/
34-
export const act: Act = async (cb) => {
35-
const React = await import('react')
36-
34+
export const act: Act = (cb) => {
3735
if ('act' in React) {
3836
return React.act(cb)
3937
}
4038

41-
throw new Error('R3F: React.act is unavailable in this environment.')
39+
throw new Error('act(...) is not supported in production builds of React')
4240
}
4341

4442
export type Camera = (THREE.OrthographicCamera | THREE.PerspectiveCamera) & { manual?: boolean }

0 commit comments

Comments
 (0)