Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: facebook/react
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bdc23c3dba86eaa03c7accecc16e8fd997e9185e
Choose a base ref
...
head repository: facebook/react
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b27448f919e3b0d7ea10de3dd55a7e192e6021a
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Apr 9, 2021

  1. Copy the full SHA
    3b27448 View commit details
Showing with 20 additions and 24 deletions.
  1. +10 −12 packages/react-reconciler/src/ReactChildFiber.new.js
  2. +10 −12 packages/react-reconciler/src/ReactChildFiber.old.js
22 changes: 10 additions & 12 deletions packages/react-reconciler/src/ReactChildFiber.new.js
Original file line number Diff line number Diff line change
@@ -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) {
22 changes: 10 additions & 12 deletions packages/react-reconciler/src/ReactChildFiber.old.js
Original file line number Diff line number Diff line change
@@ -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) {