Remove unnecessary type cast (#21363)

This commit is contained in:
Sebastian Silbermann
2021-04-27 18:37:14 +02:00
committed by GitHub
parent 4edbcdc327
commit 29faeb2df3

View File

@@ -9,6 +9,7 @@
import type {Container} from './ReactDOMHostConfig';
import type {RootType} from './ReactDOMRoot';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {ReactNodeList} from 'shared/ReactTypes';
import {
@@ -184,10 +185,8 @@ function legacyRenderSubtreeIntoContainer(
warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
}
// TODO: Without `any` type, Flow says "Property cannot be accessed on any
// member of intersection type." Whyyyyyy.
let root: RootType = (container._reactRootContainer: any);
let fiberRoot;
let root = container._reactRootContainer;
let fiberRoot: FiberRoot;
if (!root) {
// Initial mount
root = container._reactRootContainer = legacyCreateRootFromDOMContainer(