diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index 2e0037fb7f..9a72e473b6 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -1184,6 +1184,7 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js * unmounts components with uncaught errors * does not interrupt unmounting if detaching a ref throws * handles error thrown by host config while working on failed root +* handles error thrown by top-level callback src/renderers/shared/fiber/__tests__/ReactIncrementalReflection-test.js * handles isMounted even when the initial render is deferred diff --git a/src/renderers/shared/fiber/ReactFiberScheduler.js b/src/renderers/shared/fiber/ReactFiberScheduler.js index 08be5dbfda..f9a8c87afa 100644 --- a/src/renderers/shared/fiber/ReactFiberScheduler.js +++ b/src/renderers/shared/fiber/ReactFiberScheduler.js @@ -117,7 +117,7 @@ module.exports = function(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig(config : HostConfig { expect(() => ReactNoop.flush()).toThrow('Error in host config.'); }); }); + + it('handles error thrown by top-level callback', () => { + ReactNoop.render(
, () => { + throw new Error('Error!'); + }); + expect(() => ReactNoop.flush()).toThrow('Error!'); + }); });