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 0deae3f commit 0c3ffaaCopy full SHA for 0c3ffaa
packages/fiber/src/core/utils.tsx
@@ -31,14 +31,12 @@ export type Act = <T = any>(cb: () => Promise<T>) => Promise<T>
31
/**
32
* Safely flush async effects when testing, simulating a legacy root.
33
*/
34
-export const act: Act = async (cb) => {
35
- const React = await import('react')
36
-
+export const act: Act = (cb) => {
37
if ('act' in React) {
38
return React.act(cb)
39
}
40
41
- throw new Error('R3F: React.act is unavailable in this environment.')
+ throw new Error('act(...) is not supported in production builds of React')
42
43
44
export type Camera = (THREE.OrthographicCamera | THREE.PerspectiveCamera) & { manual?: boolean }
0 commit comments