File tree 1 file changed +5
-1
lines changed
packages/next/src/client/components/react-dev-overlay/ui/components
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ export function ShadowPortal({ children }: { children: React.ReactNode }) {
7
7
let shadowNode = React . useRef < ShadowRoot | null > ( null )
8
8
let [ , forceUpdate ] = React . useState < { } | undefined > ( )
9
9
10
- React . useLayoutEffect ( ( ) => {
10
+ // Don't use useLayoutEffect here, as it will cause warnings during SSR in React 18.
11
+ // Don't use useSyncExternalStore as an SSR gate unless you verified it doesn't
12
+ // downgrade a Transition of the initial root render to a sync render or
13
+ // we can assure the root render is not a Transition.
14
+ React . useEffect ( ( ) => {
11
15
const ownerDocument = document
12
16
portalNode . current = ownerDocument . createElement ( 'nextjs-portal' )
13
17
// load default color preference from localstorage
You can’t perform that action at this time.
0 commit comments