-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix(react): prevent rendering fallback if not shouldCatch error #1410
fix(react): prevent rendering fallback if not shouldCatch error #1410
Conversation
🦋 Changeset detectedLatest commit: d8c6c22 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
People can be co-author:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: -9 B (-0.01%) Total Size: 68.9 kB
ℹ️ View Unchanged
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1410 +/- ##
==========================================
- Coverage 73.89% 73.85% -0.05%
==========================================
Files 70 70
Lines 590 589 -1
Branches 131 131
==========================================
- Hits 436 435 -1
Misses 142 142
Partials 12 12
|
Co-authored-by: lucas0530 <[email protected]> Co-authored-by: HYUNGU KANG <[email protected]>
43647c6
to
5501676
Compare
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.
👍
@gwansikk @kangju2000 Check this PR together please. this is important fix in my opinion |
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.
I agree with this change. If shouldCatch
is false, I believe the fallback itself should not be executed.
In my opinion, the fallback of an ErrorBoundary is meant to act as a substitute for an error. Therefore, if error capturing has not occurred through shouldCatch, the ErrorBoundary should not treat it as an error, and the fallback itself should not be executed.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @suspensive/[email protected] ### Patch Changes - [#1410](#1410) [`ce3cb11`](ce3cb11) Thanks [@manudeli](https://github.com/manudeli)! - fix(react): prevent rendering fallback if not shouldCatch error ## @suspensive/[email protected] ### Patch Changes - Updated dependencies \[[`ce3cb11`](ce3cb11)]: - @suspensive/[email protected] - @suspensive/[email protected] - @suspensive/[email protected] ## @suspensive/[email protected] ### Patch Changes - Updated dependencies \[[`ce3cb11`](ce3cb11)]: - @suspensive/[email protected] ## @suspensive/[email protected] ### Patch Changes - Updated dependencies \[[`ce3cb11`](ce3cb11)]: - @suspensive/[email protected] ## @suspensive/[email protected]
issued by @LineGu @lucas0530
Prevent rendering fallback if not shouldCatch error
fallback should be exposed only when error is catched by ErrorBoundary
But in this case fallback was rendered and
console.log("child ErrorBoundary's fallback")
was excuted. so we fixed itPR Checklist