File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
/* eslint-disable @typescript-eslint/explicit-function-return-type */
2
- import { useCallback , useInsertionEffect , useRef } from 'react' ;
3
+ import React , { useCallback , useRef } from 'react' ;
3
4
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect' ;
4
5
5
- const useInsertionEffectFallback = useInsertionEffect || useIsomorphicLayoutEffect ;
6
+ // Prevent webpack from importing this:
7
+ // https://github.com/webpack/webpack/issues/14814#issuecomment-1536757985
8
+ // https://github.com/radix-ui/primitives/issues/2796
9
+ const useReactInsertionEffect = ( React as any ) [ ' useInsertionEffect ' . trim ( ) . toString ( ) ] ;
10
+ const useInsertionEffectFallback = useReactInsertionEffect || useIsomorphicLayoutEffect ;
6
11
7
12
/**
8
13
* This hook is user-land implementation of the experimental `useEffectEvent` hook.
You can’t perform that action at this time.
0 commit comments