sentry-javascript
sentry-javascript copied to clipboard
feat(react): type error as unknown in ErrorBoundary
Fixes https://github.com/getsentry/sentry-javascript/issues/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:
- https://react.dev/reference/react/Component#componentdidcatch
- https://github.com/DefinitelyTyped/DefinitelyTyped/pull/69434