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

TypeScript issue w/ React #633

Closed
joshuap opened this issue Sep 9, 2021 · 4 comments
Closed

TypeScript issue w/ React #633

joshuap opened this issue Sep 9, 2021 · 4 comments
Assignees

Comments

@joshuap
Copy link
Member

joshuap commented Sep 9, 2021

Here's an issue reported via email. I wonder if there's a TS definition bug in honeybadger-react related to the recent TS fixes in honeybadger-js?

 I'm currently working on updating typescript and other dependencies in next.js app, and I have found an issue with your package. I'm using the latest 3.2.4 version as it is described in https://docs.honeybadger.io/lib/javascript/integration/react/

The issue is that const honeybadger = Honeybadger.configure(config) returns type Client, but  component expects different type and produces an error message: 

No overload matches this call.
  Overload 1 of 2, '(props: Props | Readonly<Props>): ErrorBoundary', gave the following error.
    Type 'Client' is not assignable to type 'Honeybadger'.
      Type 'Client' is missing the following properties from type 'Honeybadger': errorHandler, requestHandler, lambdaHandler
  Overload 2 of 2, '(props: Props, context: any): ErrorBoundary', gave the following error.
    Type 'Client' is not assignable to type 'Honeybadger'.
      Type 'Client' is not assignable to type 'Honeybadger'.ts(2769)
honeybadger-react.d.ts(6, 5): The expected type comes from property 'honeybadger' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<ErrorBoundary> & Readonly<Props> & Readonly<{ ...; }>'
honeybadger-react.d.ts(6, 5): The expected type comes from property 'honeybadger'

Front logo Front conversations

@joshuap
Copy link
Member Author

joshuap commented Sep 10, 2021

@subzero10 can you take a look at this and #634 when you get the chance?

@subzero10
Copy link
Member

@subzero10 can you take a look at this and #634 when you get the chance?

Yes! Will do!

@subzero10
Copy link
Member

@joshuap Regarding this ticket, please my PR on honeybadger-react.

@joshuap
Copy link
Member Author

joshuap commented Sep 14, 2021

I released the fix for this in @honeybadger-io/react 1.0.2

@joshuap joshuap closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants