Typescript for error on fallback function? #12571
Answered
by
AbhiPrasad
louispotok
asked this question in
Q&A
|
I use Typescript in my project and just updated from v7 to v8. I see that the FallbackRender type now has |
Answered by
AbhiPrasad
Jun 20, 2024
Replies: 1 comment 2 replies
|
@louispotok this is intentional because anything can be used with a I think you should use |
2 replies
Answer selected by
louispotok
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@louispotok this is intentional because anything can be used with a
throwstatement. See: https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#updated-error-types-to-be-unknown-instead-of-errorI think you should use
typeof Errorchecks to enforce that the thrown variable is an error.