mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove textarea special case from child fiber (#21222)
This commit is contained in:
committed by
GitHub
parent
bdc23c3dba
commit
8a4a59c725
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user