Skip to content

Commit

Permalink
expose isHydrating (#16909)
Browse files Browse the repository at this point in the history
expose isHydrating for FB
  • Loading branch information
lunaruan authored Sep 26, 2019
1 parent db8afe4 commit c8dc7a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react-dom/src/client/ReactDOMFB.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import {findCurrentFiberUsingSlowPath} from 'react-reconciler/reflection';
import {getIsHydrating} from 'react-reconciler/src/ReactFiberHydrationContext';
import {get as getInstance} from 'shared/ReactInstanceMap';
import {addUserTimingListener} from 'shared/ReactFeatureFlags';

Expand All @@ -33,6 +34,8 @@ Object.assign(
},
// Perf experiment
addUserTimingListener,

getIsHydrating,
},
);

Expand Down
5 changes: 5 additions & 0 deletions packages/react-reconciler/src/ReactFiberHydrationContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ function resetHydrationState(): void {
isHydrating = false;
}

function getIsHydrating(): boolean {
return isHydrating;
}

export {
warnIfHydrating,
enterHydrationState,
Expand All @@ -494,4 +498,5 @@ export {
prepareToHydrateHostTextInstance,
prepareToHydrateHostSuspenseInstance,
popHydrationState,
getIsHydrating,
};

0 comments on commit c8dc7a9

Please sign in to comment.