File tree 2 files changed +5
-5
lines changed
code/lib/react-dom-shim/src
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/no-deprecated */
2
2
import type { ReactElement } from 'react' ;
3
- import ReactDOM from 'react-dom' ;
3
+ import * as ReactDOM from 'react-dom' ;
4
4
5
5
export const renderElement = async ( node : ReactElement , el : Element ) => {
6
6
return new Promise < null > ( ( resolve ) => {
Original file line number Diff line number Diff line change 1
1
import type { FC , ReactElement } from 'react' ;
2
- import React , { useLayoutEffect , useRef } from 'react' ;
2
+ import * as React from 'react' ;
3
3
import type { Root as ReactRoot , RootOptions } from 'react-dom/client' ;
4
- import ReactDOM from 'react-dom/client' ;
4
+ import * as ReactDOM from 'react-dom/client' ;
5
5
6
6
// A map of all rendered React 18 nodes
7
7
const nodes = new Map < Element , ReactRoot > ( ) ;
@@ -11,8 +11,8 @@ const WithCallback: FC<{ callback: () => void; children: ReactElement }> = ({
11
11
children,
12
12
} ) => {
13
13
// See https://github.com/reactwg/react-18/discussions/5#discussioncomment-2276079
14
- const once = useRef < ( ) => void > ( ) ;
15
- useLayoutEffect ( ( ) => {
14
+ const once = React . useRef < ( ) => void > ( ) ;
15
+ React . useLayoutEffect ( ( ) => {
16
16
if ( once . current === callback ) return ;
17
17
once . current = callback ;
18
18
callback ( ) ;
You can’t perform that action at this time.
0 commit comments