Remove unnecessary type cast (#21363)
Sebastian Silbermann committed
Apr 27, 2021 at 18:37 UTC
29faeb2df30347dc260fe4681d4526876c351db1
1 file changed
+3
-4
packages/react-dom/src/client/ReactDOMLegacy.js
+3
-4
@@ -9,6 +9,7 @@
9
10
import type {Container} from './ReactDOMHostConfig';
11
import type {RootType} from './ReactDOMRoot';
12
+import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
13
import type {ReactNodeList} from 'shared/ReactTypes';
14
15
import {
@@ -184,10 +185,8 @@ function legacyRenderSubtreeIntoContainer(
185
warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
186
}
187
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;
190
if (!root) {
191
// Initial mount
192
root = container._reactRootContainer = legacyCreateRootFromDOMContainer(