Remove textarea special case from child fiber (#21222)

This commit is contained in:
Sebastian Markbåge
2021-04-09 17:02:13 -04:00
committed by GitHub
parent bdc23c3dba
commit 8a4a59c725
2 changed files with 20 additions and 24 deletions
@@ -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) {
@@ -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) {