Skip to content

Commit c3cad3b

Browse files
committed
Remove recursion from handleErrors
Changed the algorithm of handleErrors a bit to ensure that boundaries are not revisited once they are acknowledged.
1 parent 2cc85e6 commit c3cad3b

File tree

5 files changed

+129
-133
lines changed

5 files changed

+129
-133
lines changed

scripts/fiber/tests-failing.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactEmptyComponent-test.js
565565
* throws when rendering null at the top level
566566
* preserves the dom node during updates
567567

568-
src/renderers/shared/stack/reconciler/__tests__/ReactErrorBoundaries-test.js
569-
* propagates errors on retry on mounting
570-
571568
src/renderers/shared/stack/reconciler/__tests__/ReactMultiChild-test.js
572569
* should warn for duplicated keys with component stack info
573570

scripts/fiber/tests-passing.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactErrorBoundaries-test.js
10331033
* renders an error state if child throws in constructor
10341034
* renders an error state if child throws in componentWillMount
10351035
* mounts the error message if mounting fails
1036+
* propagates errors on retry on mounting
10361037
* propagates errors inside boundary during componentWillMount
10371038
* propagates errors inside boundary while rendering error state
10381039
* does not register event handlers for unmounted children

src/renderers/shared/fiber/ReactFiberCommitWork.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
'use strict';
1414

15-
import type { TrappedError } from 'ReactFiberErrorBoundary';
15+
import type { TrappedError } from 'ReactFiberScheduler';
1616
import type { Fiber } from 'ReactFiber';
1717
import type { FiberRoot } from 'ReactFiberRoot';
1818
import type { HostConfig } from 'ReactFiberReconciler';
@@ -24,7 +24,6 @@ var {
2424
HostComponent,
2525
HostText,
2626
} = ReactTypeOfWork;
27-
var { trapError } = require('ReactFiberErrorBoundary');
2827
var { callCallbacks } = require('ReactFiberUpdateQueue');
2928

3029
var {
@@ -33,7 +32,10 @@ var {
3332
Callback,
3433
} = require('ReactTypeOfSideEffect');
3534

36-
module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
35+
module.exports = function<T, P, I, TI, C>(
36+
config : HostConfig<T, P, I, TI, C>,
37+
trapError : (boundary : Fiber, error: Error) => TrappedError
38+
) {
3739

3840
const updateContainer = config.updateContainer;
3941
const commitUpdate = config.commitUpdate;

src/renderers/shared/fiber/ReactFiberErrorBoundary.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)