@samitouri / QOS-React / commits / cecfde51b6

Don't import star from ReactDOM (#21133)

Sebastian Markbåge committed Mar 29, 2021 at 22:35 UTC cecfde51b63ff33afde0d63ed32de53782c6e14c
1 file changed +3 -3
packages/react-dom/src/client/ReactDOMOption.js
+3 -3
@@ -7,7 +7,7 @@
7 * @flow
8 */
9
10 -import * as React from 'react';
10 +import {Children} from 'react';
11 import {getToStringValue, toString} from './ToStringValue';
12
13 let didWarnSelectedSetOnOption = false;
@@ -21,7 +21,7 @@ function flattenChildren(children) {
21 // Note that this would throw on non-element objects.
22 // Elements are stringified (which is normally irrelevant
23 // but matters for <fbt>).
24 - React.Children.forEach(children, function(child) {
24 + Children.forEach(children, function(child) {
25 if (child == null) {
26 return;
27 }
@@ -45,7 +45,7 @@ export function validateProps(element: Element, props: Object) {
45 // TODO: this seems like it could cause a DEV-only throw for hydration
46 // if children contains a non-element object. We should try to avoid that.
47 if (typeof props.children === 'object' && props.children !== null) {
48 - React.Children.forEach(props.children, function(child) {
48 + Children.forEach(props.children, function(child) {
49 if (child == null) {
50 return;
51 }