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