-
Notifications
You must be signed in to change notification settings - Fork 5
add allowErrorBoundary option #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add allowErrorBoundary option #29
Conversation
|
Thanks for the PR @henryqdineen. Agreed on |
#CHANGELOG.md
## v5.0.0
- `allowComponentDidCatch` has been replaced with `allowErrorBoundary`. Like `allowComponentDidCatch`, `allowErrorBoundary` defaults to true, but `allowErrorBoundary` allows class components that use `componentDidCatch` and/or `getDerivedStateFromError`. No change is required if you're using the defaults for this lint rule. If you've disabled `allowComponentDidCatch`, you'll need to make the following change:
```diff
- "react-prefer-function-component": [true, { "allowComponentDidCatch": false }]
+ "react-prefer-function-component": [true, { "allowErrorBoundary": false }] |
b231381 to
b0f08c4
Compare
|
Thanks @tatethurston! I just pushed a commit to implement |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
===========================================
- Coverage 100.00% 99.05% -0.95%
===========================================
Files 3 3
Lines 103 106 +3
Branches 18 21 +3
===========================================
+ Hits 103 105 +2
- Misses 0 1 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tatethurston
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
This PR adds an
allowErrorBoundaryoption to replace theallowComponentDidCatchoption. This new option will allow bothcomponentDidCatchandstatic getDerivedStateFromErrormethods could be present in an error boundary. Thanks!