File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @react-three/fiber ' : patch
3+ ---
4+
5+ Fix failing builds for production when React.act is unavailable. This fixes issues found in
[email protected] and up.
Original file line number Diff line number Diff line change @@ -31,7 +31,13 @@ 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 = ( React as any ) . act
34+ export const act : Act = ( cb ) => {
35+ if ( 'act' in React ) {
36+ return React . act ( cb )
37+ }
38+
39+ throw new Error ( 'act(...) is not supported in production builds of React' )
40+ }
3541
3642export type Camera = ( THREE . OrthographicCamera | THREE . PerspectiveCamera ) & { manual ?: boolean }
3743export const isOrthographicCamera = ( def : Camera ) : def is THREE . OrthographicCamera =>
You can’t perform that action at this time.
0 commit comments