Confusing code in /Advanced/AsyncActions page
Michael Luder-Rosefield
This snippet here:
.then(
response => response.json(),
// Do not use catch, because that will also catch
// any errors in the dispatch and resulting render,
// causing a loop of 'Unexpected batch number' errors.
// https://github.com/facebook/react/issues/6895
error => console.log('An error occurred.', error)
)
I understand the warning not to use
.catch(fn)
, since it swallows exceptions, but .then(_, fn)
, as used above, also swallows the exception.