ctrlplusb / react-async-component

Resolve components asynchronously, with support for code splitting and advanced server side rendering use cases.
MIT License
1.45k stars 62 forks source link

Add `throwError` config option for ErrorBoundaries #66

Closed fuhton closed 6 years ago

fuhton commented 6 years ago

Add a boolean flag to throw an error instead of rendering the passed ErrorComponent. This is extrememly useful for Error Boundaries as introduced in react@16.0.0.

This is referencing #65 and gives some insight to the feature request. Let me know if this isn't quite right or not in the direction of the project.

codecov[bot] commented 6 years ago

Codecov Report

Merging #66 into master will increase coverage by 1.22%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #66      +/-   ##
=========================================
+ Coverage   94.38%   95.6%   +1.22%     
=========================================
  Files           3       3              
  Lines          89      91       +2     
  Branches       25      26       +1     
=========================================
+ Hits           84      87       +3     
+ Misses          5       4       -1
Impacted Files Coverage Δ
src/asyncComponent.js 94.52% <100%> (+1.56%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 94fc382...1f5a428. Read the comment docs.