File tree 2 files changed +6
-4
lines changed
packages/react-reconciler/src
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -222,14 +222,15 @@ function coerceRef(
222
222
223
223
function throwOnInvalidObjectType ( returnFiber : Fiber , newChild : Object ) {
224
224
if ( returnFiber . type !== 'textarea' ) {
225
+ const childString = Object . prototype . toString . call ( newChild ) ;
225
226
invariant (
226
227
false ,
227
228
'Objects are not valid as a React child (found: %s). ' +
228
229
'If you meant to render a collection of children, use an array ' +
229
230
'instead.' ,
230
- Object . prototype . toString . call ( newChild ) === '[object Object]'
231
+ childString === '[object Object]'
231
232
? 'object with keys {' + Object . keys ( newChild ) . join ( ', ' ) + '}'
232
- : newChild ,
233
+ : childString ,
233
234
) ;
234
235
}
235
236
}
Original file line number Diff line number Diff line change @@ -222,14 +222,15 @@ function coerceRef(
222
222
223
223
function throwOnInvalidObjectType ( returnFiber : Fiber , newChild : Object ) {
224
224
if ( returnFiber . type !== 'textarea' ) {
225
+ const childString = Object . prototype . toString . call ( newChild ) ;
225
226
invariant (
226
227
false ,
227
228
'Objects are not valid as a React child (found: %s). ' +
228
229
'If you meant to render a collection of children, use an array ' +
229
230
'instead.' ,
230
- Object . prototype . toString . call ( newChild ) === '[object Object]'
231
+ childString === '[object Object]'
231
232
? 'object with keys {' + Object . keys ( newChild ) . join ( ', ' ) + '}'
232
- : newChild ,
233
+ : childString ,
233
234
) ;
234
235
}
235
236
}
You can’t perform that action at this time.
0 commit comments