File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import {
3939 findHostInstanceWithWarning ,
4040 flushPassiveEffects ,
4141 IsThisRendererActing ,
42+ attemptSynchronousHydration ,
4243} from 'react-reconciler/inline.dom' ;
4344import { createPortal as createPortalImpl } from 'shared/ReactPortal' ;
4445import { canUseDOM } from 'shared/ExecutionEnvironment' ;
@@ -74,6 +75,7 @@ import {
7475} from './ReactDOMComponentTree' ;
7576import { restoreControlledState } from './ReactDOMComponent' ;
7677import { dispatchEvent } from '../events/ReactDOMEventListener' ;
78+ import { setAttemptSynchronousHydration } from '../events/ReactDOMEventReplaying' ;
7779import { eagerlyTrapReplayableEvents } from '../events/ReactDOMEventReplaying' ;
7880import {
7981 ELEMENT_NODE ,
@@ -83,6 +85,8 @@ import {
8385} from '../shared/HTMLNodeType' ;
8486import { ROOT_ATTRIBUTE_NAME } from '../shared/DOMProperty' ;
8587
88+ setAttemptSynchronousHydration ( attemptSynchronousHydration ) ;
89+
8690const ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
8791
8892let topLevelUpdateWarnings ;
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ import {
2020 unstable_scheduleCallback as scheduleCallback ,
2121 unstable_NormalPriority as NormalPriority ,
2222} from 'scheduler' ;
23- import { attemptSynchronousHydration } from 'react-reconciler/inline.dom' ;
2423import {
2524 attemptToDispatchEvent ,
2625 trapEventForResponderEventSystem ,
@@ -32,6 +31,12 @@ import {
3231import { getInstanceFromNode } from '../client/ReactDOMComponentTree' ;
3332import { unsafeCastDOMTopLevelTypeToString } from 'legacy-events/TopLevelEventTypes' ;
3433
34+ let attemptSynchronousHydration : ( fiber : Object ) => void ;
35+
36+ export function setAttemptSynchronousHydration ( fn : ( fiber : Object ) = > void ) {
37+ attemptSynchronousHydration = fn ;
38+ }
39+
3540// TODO: Upgrade this definition once we're on a newer version of Flow that
3641// has this definition built-in.
3742type PointerEvent = Event & {
You can’t perform that action at this time.
0 commit comments