Skip to content

Commit

Permalink
Removed incorrect .return accessor from captureCommitPhaseErrorForUnm…
Browse files Browse the repository at this point in the history
…ountedFiber()
  • Loading branch information
Brian Vaughn committed Aug 13, 2020
1 parent b91b80c commit 7467f51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -3170,7 +3170,7 @@ export function captureCommitPhaseErrorForUnmountedFiber(
nearestMountedAncestor: Fiber,
error: mixed,
) {
let fiber = nearestMountedAncestor.return;
let fiber = nearestMountedAncestor;
while (fiber !== null) {
if (fiber.tag === HostRoot) {
captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ describe('ReactHooksWithNoopRenderer', () => {
return <span prop="ErrorBoundary fallback" />;
}
Scheduler.unstable_yieldValue('ErrorBoundary render success');
return this.props.children;
return this.props.children || null;
}
};

Expand All @@ -2377,7 +2377,7 @@ describe('ReactHooksWithNoopRenderer', () => {
Scheduler.unstable_yieldValue(
'DerivedStateOnlyErrorBoundary render success',
);
return this.props.children;
return this.props.children || null;
}
};

Expand All @@ -2389,7 +2389,7 @@ describe('ReactHooksWithNoopRenderer', () => {
}
render() {
Scheduler.unstable_yieldValue(`LogOnlyErrorBoundary render`);
return this.props.children;
return this.props.children || null;
}
};
});
Expand Down Expand Up @@ -2551,18 +2551,10 @@ describe('ReactHooksWithNoopRenderer', () => {

// @gate new
it('should use the nearest still-mounted boundary if there are no unmounted boundaries', () => {
function Conditional({showChildren}) {
if (showChildren) {
return <BrokenUseEffectCleanup />;
} else {
return null;
}
}

act(() => {
ReactNoop.render(
<LogOnlyErrorBoundary>
<Conditional showChildren={true} />
<BrokenUseEffectCleanup />
</LogOnlyErrorBoundary>,
);
});
Expand All @@ -2573,11 +2565,7 @@ describe('ReactHooksWithNoopRenderer', () => {
]);

act(() => {
ReactNoop.render(
<LogOnlyErrorBoundary>
<Conditional showChildren={false} />
</LogOnlyErrorBoundary>,
);
ReactNoop.render(<LogOnlyErrorBoundary />);
});

expect(Scheduler).toHaveYielded([
Expand Down

0 comments on commit 7467f51

Please sign in to comment.