diff --git a/packages/react-reconciler/src/ReactChildFiber.new.js b/packages/react-reconciler/src/ReactChildFiber.new.js index 12a693c2d2d7..e9fdf0b654b5 100644 --- a/packages/react-reconciler/src/ReactChildFiber.new.js +++ b/packages/react-reconciler/src/ReactChildFiber.new.js @@ -216,18 +216,16 @@ function coerceRef( } function throwOnInvalidObjectType(returnFiber: Fiber, newChild: Object) { - if (returnFiber.type !== 'textarea') { - const childString = Object.prototype.toString.call(newChild); - invariant( - false, - 'Objects are not valid as a React child (found: %s). ' + - 'If you meant to render a collection of children, use an array ' + - 'instead.', - childString === '[object Object]' - ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' - : childString, - ); - } + const childString = Object.prototype.toString.call(newChild); + invariant( + false, + 'Objects are not valid as a React child (found: %s). ' + + 'If you meant to render a collection of children, use an array ' + + 'instead.', + childString === '[object Object]' + ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' + : childString, + ); } function warnOnFunctionType(returnFiber: Fiber) { diff --git a/packages/react-reconciler/src/ReactChildFiber.old.js b/packages/react-reconciler/src/ReactChildFiber.old.js index 52d941d19514..34120a641ba3 100644 --- a/packages/react-reconciler/src/ReactChildFiber.old.js +++ b/packages/react-reconciler/src/ReactChildFiber.old.js @@ -216,18 +216,16 @@ function coerceRef( } function throwOnInvalidObjectType(returnFiber: Fiber, newChild: Object) { - if (returnFiber.type !== 'textarea') { - const childString = Object.prototype.toString.call(newChild); - invariant( - false, - 'Objects are not valid as a React child (found: %s). ' + - 'If you meant to render a collection of children, use an array ' + - 'instead.', - childString === '[object Object]' - ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' - : childString, - ); - } + const childString = Object.prototype.toString.call(newChild); + invariant( + false, + 'Objects are not valid as a React child (found: %s). ' + + 'If you meant to render a collection of children, use an array ' + + 'instead.', + childString === '[object Object]' + ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' + : childString, + ); } function warnOnFunctionType(returnFiber: Fiber) {