sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

feat(react): type error as unknown in ErrorBoundary

Open AbhiPrasad opened this issue 1 year ago • 0 comments

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

AbhiPrasad avatar Apr 26 '24 16:04 AbhiPrasad