Skip to content

fix(react): Set handled value in ErrorBoundary depending on fallback #10989

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Mar 8, 2024

This PR adjusts when we mark errors caught in our React SDK's ErrorBoundary as handled/unhandled.

Previously, we made a change to always mark such errors as unhandled (#8914). However, as pointed out and discussed in #10985, this isn't always the best default value. I propose we set handled/unhandled depending on the presence of the fallback component. If users specify a fallback, I think it's safe to mark the error handled, given that users show something else instead of the errored component.

Would appreciate thoughts from our React experts ;)

closes #10985

@lforst
Copy link
Contributor

lforst commented Mar 8, 2024

This makes 100% sense.

@Lms24 Lms24 merged commit 7b8874e into develop Mar 8, 2024
@Lms24 Lms24 deleted the lms/fix-react-errorboundary-handled-unhandled branch March 8, 2024 14:09
@Lms24 Lms24 mentioned this pull request Mar 12, 2024
Lms24 added a commit that referenced this pull request Mar 12, 2024
#10989)

Previously, we made a change to always mark such errors as unhandled
(#8914). However, as pointed out and discussed in #10985, this isn't
always the best default value. I propose we set handled/unhandled
depending on the presence of the `fallback` component. If users specify
a fallback, I think it's safe to mark the error handled, given that
users show something else instead of the errored component.
Lms24 added a commit that referenced this pull request Mar 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ErrorBoundary errors are being incorrectly marked as unhandled since 5.9.2
2 participants