main
js 19 lines 642 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 */
9
10 import type {FiberRoot} from './ReactInternalTypes';
11 import type {RootState} from './ReactFiberRoot';
12
13 // This is imported by the event replaying implementation in React DOM. It's
14 // in a separate file to break a circular dependency between the renderer and
15 // the reconciler.
16 export function isRootDehydrated(root: FiberRoot): boolean {
17 const currentState: RootState = root.current.memoizedState;
18 return currentState.isDehydrated;
19 }