8
8
*/
9
9
10
10
import type { ReactNodeList } from 'shared/ReactTypes' ;
11
- import type {
12
- Container ,
13
- PublicInstance ,
14
- } from 'react-dom-bindings/src/client/ReactFiberConfigDOM' ;
15
11
import type {
16
12
RootType ,
17
13
HydrateRootOptions ,
18
14
CreateRootOptions ,
19
15
} from './ReactDOMRoot' ;
20
16
21
- import {
22
- findDOMNode ,
23
- render ,
24
- unstable_renderSubtreeIntoContainer ,
25
- unmountComponentAtNode ,
26
- } from './ReactDOMLegacy' ;
27
17
import {
28
18
createRoot as createRootImpl ,
29
19
hydrateRoot as hydrateRootImpl ,
@@ -35,6 +25,7 @@ import {
35
25
flushSync as flushSyncWithoutWarningIfAlreadyRendering ,
36
26
isAlreadyRendering ,
37
27
injectIntoDevTools ,
28
+ findHostInstance ,
38
29
} from 'react-reconciler/src/ReactFiberReconciler' ;
39
30
import { runWithPriority } from 'react-reconciler/src/ReactEventPriorities' ;
40
31
import { createPortal as createPortalImpl } from 'react-reconciler/src/ReactPortal' ;
@@ -99,20 +90,6 @@ function createPortal(
99
90
return createPortalImpl ( children , container , null , key ) ;
100
91
}
101
92
102
- function renderSubtreeIntoContainer (
103
- parentComponent : React$Component < any , any > ,
104
- element : React$Element < any > ,
105
- containerNode : Container ,
106
- callback : ?Function ,
107
- ) : React$Component < any , any > | PublicInstance | null {
108
- return unstable_renderSubtreeIntoContainer (
109
- parentComponent ,
110
- element ,
111
- containerNode ,
112
- callback ,
113
- ) ;
114
- }
115
-
116
93
function createRoot (
117
94
container : Element | Document | DocumentFragment ,
118
95
options ?: CreateRootOptions ,
@@ -163,6 +140,12 @@ function flushSync<R>(fn: (() => R) | void): R | void {
163
140
return flushSyncWithoutWarningIfAlreadyRendering ( fn ) ;
164
141
}
165
142
143
+ function findDOMNode (
144
+ componentOrElement : Element | ?React$Component < any , any > ,
145
+ ) : null | Element | Text {
146
+ return findHostInstance ( componentOrElement ) ;
147
+ }
148
+
166
149
// Expose findDOMNode on internals
167
150
Internals . findDOMNode = findDOMNode ;
168
151
@@ -178,15 +161,9 @@ export {
178
161
unstable_batchedUpdates ,
179
162
flushSync ,
180
163
ReactVersion as version ,
181
- // Disabled behind disableLegacyReactDOMAPIs
182
- findDOMNode ,
183
- render ,
184
- unmountComponentAtNode ,
185
164
// exposeConcurrentModeAPIs
186
165
createRoot ,
187
166
hydrateRoot ,
188
- // Disabled behind disableUnstableRenderSubtreeIntoContainer
189
- renderSubtreeIntoContainer as unstable_renderSubtreeIntoContainer ,
190
167
// enableCreateEventHandleAPI
191
168
createEventHandle as unstable_createEventHandle ,
192
169
// TODO: Remove this once callers migrate to alternatives.
0 commit comments