File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,11 @@ export type Act = <T = any>(cb: () => Promise<T>) => Promise<T>
3030
3131/**
3232 * Safely flush async effects when testing, simulating a legacy root.
33+ * @deprecated Import from React instead. import { act } from 'react'
3334 */
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- }
35+ // Reference with computed key to break Webpack static analysis
36+ // https://github.com/webpack/webpack/issues/14814
37+ export const act : Act = React [ ( 'act' + '' ) as 'act' ]
4138
4239export type Camera = ( THREE . OrthographicCamera | THREE . PerspectiveCamera ) & { manual ?: boolean }
4340export const isOrthographicCamera = ( def : Camera ) : def is THREE . OrthographicCamera =>
You can’t perform that action at this time.
0 commit comments