99
1010import type { Container } from './ReactDOMHostConfig' ;
1111import type { MutableSource , ReactNodeList } from 'shared/ReactTypes' ;
12- import type { FiberRoot } from 'react-reconciler/src/ReactInternalTypes' ;
12+ import type {
13+ FiberRoot ,
14+ TransitionTracingCallbacks ,
15+ } from 'react-reconciler/src/ReactInternalTypes' ;
1316
1417import { queueExplicitHydrationTarget } from '../events/ReactDOMEventReplaying' ;
1518
@@ -25,6 +28,7 @@ export type CreateRootOptions = {
2528 unstable_concurrentUpdatesByDefault ?: boolean ,
2629 identifierPrefix ?: string ,
2730 onRecoverableError ?: ( error : mixed ) => void ,
31+ transitionCallbacks ? : TransitionTracingCallbacks ,
2832 ...
2933} ;
3034
@@ -158,6 +162,8 @@ export function createRoot(
158162 let concurrentUpdatesByDefaultOverride = false ;
159163 let identifierPrefix = '' ;
160164 let onRecoverableError = defaultOnRecoverableError ;
165+ let transitionCallbacks = null ;
166+
161167 if ( options !== null && options !== undefined ) {
162168 if ( __DEV__ ) {
163169 if ( ( options : any ) . hydrate ) {
@@ -181,6 +187,9 @@ export function createRoot(
181187 if ( options . onRecoverableError !== undefined ) {
182188 onRecoverableError = options . onRecoverableError ;
183189 }
190+ if ( options . transitionCallbacks !== undefined ) {
191+ transitionCallbacks = options . transitionCallbacks ;
192+ }
184193 }
185194
186195 const root = createContainer (
@@ -192,6 +201,7 @@ export function createRoot(
192201 concurrentUpdatesByDefaultOverride ,
193202 identifierPrefix ,
194203 onRecoverableError ,
204+ transitionCallbacks ,
195205 ) ;
196206 markContainerAsRoot ( root . current , container ) ;
197207
@@ -260,6 +270,8 @@ export function hydrateRoot(
260270 concurrentUpdatesByDefaultOverride ,
261271 identifierPrefix ,
262272 onRecoverableError ,
273+ // TODO(luna) Support hydration later
274+ null ,
263275 ) ;
264276 markContainerAsRoot ( root . current , container ) ;
265277 // This can't be a comment node since hydration doesn't work on comment nodes anyway.
0 commit comments