8
8
*/
9
9
10
10
import type { Container } from './ReactDOMHostConfig' ;
11
- import type { MutableSource , ReactNodeList } from 'shared/ReactTypes' ;
11
+ import type { ReactNodeList } from 'shared/ReactTypes' ;
12
12
import type { FiberRoot } from 'react-reconciler/src/ReactInternalTypes' ;
13
13
14
14
export type RootType = {
@@ -24,7 +24,6 @@ export type CreateRootOptions = {
24
24
hydrationOptions ?: {
25
25
onHydrated ?: ( suspenseNode : Comment ) => void ,
26
26
onDeleted ?: ( suspenseNode : Comment ) => void ,
27
- mutableSources ?: Array < MutableSource < any >> ,
28
27
...
29
28
} ,
30
29
// END OF TODO
@@ -35,7 +34,6 @@ export type CreateRootOptions = {
35
34
36
35
export type HydrateRootOptions = {
37
36
// Hydration options
38
- hydratedSources ?: Array < MutableSource < any >> ,
39
37
onHydrated ?: ( suspenseNode : Comment ) => void ,
40
38
onDeleted ?: ( suspenseNode : Comment ) => void ,
41
39
// Options for all roots
@@ -61,7 +59,6 @@ import {
61
59
createContainer,
62
60
updateContainer,
63
61
findHostInstanceWithNoPortals,
64
- registerMutableSourceForHydration ,
65
62
} from 'react-reconciler/src/ReactFiberReconciler' ;
66
63
import invariant from 'shared/invariant' ;
67
64
import { ConcurrentRoot} from 'react-reconciler/src/ReactRootTags' ;
@@ -129,11 +126,6 @@ export function createRoot(
129
126
const hydrate = options != null && options . hydrate === true ;
130
127
const hydrationCallbacks =
131
128
( options != null && options . hydrationOptions ) || null ;
132
- const mutableSources =
133
- ( options != null &&
134
- options . hydrationOptions != null &&
135
- options . hydrationOptions . mutableSources ) ||
136
- null ;
137
129
// END TODO
138
130
139
131
const isStrictMode = options != null && options . unstable_strictMode === true ;
@@ -159,15 +151,6 @@ export function createRoot(
159
151
container . nodeType === COMMENT_NODE ? container . parentNode : container ;
160
152
listenToAllSupportedEvents ( rootContainerElement ) ;
161
153
162
- // TODO: Delete this path
163
- if ( mutableSources ) {
164
- for ( let i = 0 ; i < mutableSources . length ; i ++ ) {
165
- const mutableSource = mutableSources [ i ] ;
166
- registerMutableSourceForHydration ( root , mutableSource ) ;
167
- }
168
- }
169
- // END TODO
170
-
171
154
return new ReactDOMRoot ( root ) ;
172
155
}
173
156
@@ -185,7 +168,6 @@ export function hydrateRoot(
185
168
// For now we reuse the whole bag of options since they contain
186
169
// the hydration callbacks.
187
170
const hydrationCallbacks = options != null ? options : null ;
188
- const mutableSources = ( options != null && options . hydratedSources ) || null ;
189
171
const isStrictMode = options != null && options . unstable_strictMode === true ;
190
172
191
173
let concurrentUpdatesByDefaultOverride = null ;
@@ -208,13 +190,6 @@ export function hydrateRoot(
208
190
// This can't be a comment node since hydration doesn't work on comment nodes anyway.
209
191
listenToAllSupportedEvents ( container ) ;
210
192
211
- if ( mutableSources ) {
212
- for ( let i = 0 ; i < mutableSources . length ; i ++ ) {
213
- const mutableSource = mutableSources [ i ] ;
214
- registerMutableSourceForHydration ( root , mutableSource ) ;
215
- }
216
- }
217
-
218
193
// Render the initial children
219
194
updateContainer ( initialChildren , root , null , null ) ;
220
195
0 commit comments