Skip to content

Commit 29faeb2

Browse files
authored
Remove unnecessary type cast (#21363)
1 parent 4edbcdc commit 29faeb2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/react-dom/src/client/ReactDOMLegacy.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import type {Container} from './ReactDOMHostConfig';
1111
import type {RootType} from './ReactDOMRoot';
12+
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
1213
import type {ReactNodeList} from 'shared/ReactTypes';
1314

1415
import {
@@ -184,10 +185,8 @@ function legacyRenderSubtreeIntoContainer(
184185
warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
185186
}
186187

187-
// TODO: Without `any` type, Flow says "Property cannot be accessed on any
188-
// member of intersection type." Whyyyyyy.
189-
let root: RootType = (container._reactRootContainer: any);
190-
let fiberRoot;
188+
let root = container._reactRootContainer;
189+
let fiberRoot: FiberRoot;
191190
if (!root) {
192191
// Initial mount
193192
root = container._reactRootContainer = legacyCreateRootFromDOMContainer(

0 commit comments

Comments
 (0)