mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Remove textarea special case from child fiber (#21222)
This commit is contained in:
1 parent
bdc23c3dba
commit
8a4a59c725
2 files changed
+20
-24
No files matched your search
@@ -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