Skip to content
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

feat(react): type error as unknown in ErrorBoundary #11819

Merged
merged 3 commits into from Apr 29, 2024

Conversation

AbhiPrasad
Copy link
Member

Fixes #11728

As reporting in the above issue, it is not typesafe to type the error thrown by react components as Error, it can actually be any JS object/primitive that was thrown. This means we have to type everything as unknown.

This change only will happen for 8.x because it's a breaking change.

Related:

@AbhiPrasad AbhiPrasad requested a review from a team April 26, 2024 16:33
@AbhiPrasad AbhiPrasad self-assigned this Apr 26, 2024
@AbhiPrasad AbhiPrasad requested review from stephanie-anderson and lforst and removed request for a team April 26, 2024 16:33
@mydea mydea merged commit 7759d18 into develop Apr 29, 2024
76 checks passed
@mydea mydea deleted the abhi-error-boundary-unknown branch April 29, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React ErrorBoundary component is not type safe
2 participants