88 */
99
1010import type { Container } from './ReactDOMHostConfig' ;
11- import type { MutableSource , ReactNodeList } from 'shared/ReactTypes' ;
11+ import type { ReactNodeList } from 'shared/ReactTypes' ;
1212import type { FiberRoot } from 'react-reconciler/src/ReactInternalTypes' ;
1313
1414export type RootType = {
@@ -24,7 +24,6 @@ export type CreateRootOptions = {
2424 hydrationOptions ?: {
2525 onHydrated ?: ( suspenseNode : Comment ) => void ,
2626 onDeleted ?: ( suspenseNode : Comment ) => void ,
27- mutableSources ?: Array < MutableSource < any >> ,
2827 ...
2928 } ,
3029 // END OF TODO
@@ -35,7 +34,6 @@ export type CreateRootOptions = {
3534
3635export type HydrateRootOptions = {
3736 // Hydration options
38- hydratedSources ?: Array < MutableSource < any >> ,
3937 onHydrated ?: ( suspenseNode : Comment ) => void ,
4038 onDeleted ?: ( suspenseNode : Comment ) => void ,
4139 // Options for all roots
@@ -61,7 +59,6 @@ import {
6159 createContainer,
6260 updateContainer,
6361 findHostInstanceWithNoPortals,
64- registerMutableSourceForHydration ,
6562} from 'react-reconciler/src/ReactFiberReconciler' ;
6663import invariant from 'shared/invariant' ;
6764import { ConcurrentRoot} from 'react-reconciler/src/ReactRootTags' ;
@@ -129,11 +126,6 @@ export function createRoot(
129126 const hydrate = options != null && options . hydrate === true ;
130127 const hydrationCallbacks =
131128 ( options != null && options . hydrationOptions ) || null ;
132- const mutableSources =
133- ( options != null &&
134- options . hydrationOptions != null &&
135- options . hydrationOptions . mutableSources ) ||
136- null ;
137129 // END TODO
138130
139131 const isStrictMode = options != null && options . unstable_strictMode === true ;
@@ -159,15 +151,6 @@ export function createRoot(
159151 container . nodeType === COMMENT_NODE ? container . parentNode : container ;
160152 listenToAllSupportedEvents ( rootContainerElement ) ;
161153
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-
171154 return new ReactDOMRoot ( root ) ;
172155}
173156
@@ -185,7 +168,6 @@ export function hydrateRoot(
185168 // For now we reuse the whole bag of options since they contain
186169 // the hydration callbacks.
187170 const hydrationCallbacks = options != null ? options : null ;
188- const mutableSources = ( options != null && options . hydratedSources ) || null ;
189171 const isStrictMode = options != null && options . unstable_strictMode === true ;
190172
191173 let concurrentUpdatesByDefaultOverride = null ;
@@ -208,13 +190,6 @@ export function hydrateRoot(
208190 // This can't be a comment node since hydration doesn't work on comment nodes anyway.
209191 listenToAllSupportedEvents ( container ) ;
210192
211- if ( mutableSources ) {
212- for ( let i = 0 ; i < mutableSources . length ; i ++ ) {
213- const mutableSource = mutableSources [ i ] ;
214- registerMutableSourceForHydration ( root , mutableSource ) ;
215- }
216- }
217-
218193 // Render the initial children
219194 updateContainer ( initialChildren , root , null , null ) ;
220195
0 commit comments