Skip to content

ErrorBoundary props for TS #1112

Open
Open
@Meetyouafter

Description

@Meetyouafter

Hello, everyone!
My App is React with TS latest version.
I wanted to pass level, errorMessage , extra to ErrorBoundary like this:

const level = (error: Error, info: ErrorInfo): LEVEL => error instanceof TypeError ? LEVEL_ERROR : LEVEL_WARN;

but i get an error: Type '(error: any, info: any) => "warn" | "error"' is not assignable to type 'LEVEL | (() => LEVEL) | undefined'.

I changed type in index.d.ts in @rollbar package with pass (error, info) to this values in ErrorBoundaryProps, but it doesn't help for me.

I did something wrong or what?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions