File tree Expand file tree Collapse file tree 2 files changed +20
-24
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -216,18 +216,16 @@ function coerceRef(
216216}
217217
218218function 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+ ) ;
231229}
232230
233231function warnOnFunctionType ( returnFiber : Fiber ) {
Original file line number Diff line number Diff line change @@ -216,18 +216,16 @@ function coerceRef(
216216}
217217
218218function 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+ ) ;
231229}
232230
233231function warnOnFunctionType ( returnFiber : Fiber ) {
You can’t perform that action at this time.
0 commit comments