Skip to content

Commit

Permalink
Avoid infinite rerender loop when top-most error boundary attempts to…
Browse files Browse the repository at this point in the history
… handle errors of its children, but fails
  • Loading branch information
rpetrich committed May 30, 2018
1 parent b853143 commit 30cde7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vdom/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function renderComponent(component, renderMode, mountAll, isChild) {
skip = false,
snapshot = previousContext,
rendered, inst, cbase,
exception, caught = component._caught;
exception, clearCaught = component._caught;

try {
if (component.constructor.getDerivedStateFromProps) {
Expand Down Expand Up @@ -178,6 +178,7 @@ export function renderComponent(component, renderMode, mountAll, isChild) {
}
} catch (e) {
exception = e;
clearCaught = false;
if (!base) {
base = initialBase || document.createTextNode("");
}
Expand Down Expand Up @@ -228,7 +229,7 @@ export function renderComponent(component, renderMode, mountAll, isChild) {

while (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);

if (caught) {
if (clearCaught) {
component._caught = false;
}

Expand Down

0 comments on commit 30cde7b

Please sign in to comment.