File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -159,17 +159,18 @@ function traverseAllChildrenImpl(
159
159
} else {
160
160
const iteratorFn = getIteratorFn ( children ) ;
161
161
if ( typeof iteratorFn === 'function' ) {
162
- if ( iteratorFn === children . entries ) {
163
- if ( disableMapsAsChildren ) {
164
- invariant (
165
- false ,
166
- 'Maps are not valid as a React child (found: %s). Consider converting ' +
167
- 'children to an array of keyed ReactElements instead.' ,
168
- children ,
169
- ) ;
170
- }
162
+ if ( disableMapsAsChildren ) {
163
+ invariant (
164
+ iteratorFn !== children . entries ,
165
+ 'Maps are not valid as a React child (found: %s). Consider converting ' +
166
+ 'children to an array of keyed ReactElements instead.' ,
167
+ children ,
168
+ ) ;
169
+ }
170
+
171
+ if ( __DEV__ ) {
171
172
// Warn about using Maps as children
172
- if ( __DEV__ ) {
173
+ if ( iteratorFn === children . entries ) {
173
174
if ( ! didWarnAboutMaps ) {
174
175
console . warn (
175
176
'Using Maps as children is deprecated and will be removed in ' +
You can’t perform that action at this time.
0 commit comments