Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions scripts/fiber/tests-failing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ src/renderers/shared/hooks/__tests__/ReactHostOperationHistoryHook-test.js
src/renderers/shared/shared/__tests__/ReactComponentLifeCycle-test.js
* should carry through each of the phases of setup

src/renderers/shared/shared/__tests__/ReactEmptyComponent-test.js
* should still throw when rendering to undefined

src/renderers/shared/shared/__tests__/ReactMultiChildText-test.js
* should reorder keyed text nodes

Expand Down
1 change: 1 addition & 0 deletions scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ src/renderers/shared/shared/__tests__/ReactCompositeComponentState-test.js

src/renderers/shared/shared/__tests__/ReactEmptyComponent-test.js
* should not produce child DOM nodes for null and false
* should still throw when rendering to undefined
* should be able to switch between rendering null and a normal tag
* should be able to switch in a list of children
* should distinguish between a script placeholder and an actual script tag
Expand Down
7 changes: 5 additions & 2 deletions src/renderers/shared/fiber/ReactChildFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,10 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
if (disableNewFiberFeatures) {
// The new child is not an element. If it's not null or false,
// and the return fiber is a composite component, throw an error.
let componentNameSuffix = '(...)';
switch (returnFiber.tag) {
case ClassComponent: {
componentNameSuffix = '.render()';
if (__DEV__) {
const instance = returnFiber.stateNode;
if (instance.render._isMockFunction && typeof newChild === 'undefined') {
Expand All @@ -1208,10 +1210,11 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) {
const Component = returnFiber.type;
invariant(
newChild === null || newChild === false,
'%s(...): A valid React element (or null) must be ' +
'%s%s: A valid React element (or null) must be ' +
'returned. You may have returned undefined, an array or some ' +
'other invalid object.',
Component.displayName || Component.name || 'Component'
Component.displayName || Component.name || 'Component',
componentNameSuffix
);
}
}
Expand Down