Giter Site home page Giter Site logo

Comments (4)

JustFly1984 avatar JustFly1984 commented on June 13, 2024 1

Yes, it is fixed!Thank you @joshuap

from honeybadger-react.

JustFly1984 avatar JustFly1984 commented on June 13, 2024

I have an issue with @honeybadger-io/react and typescript in one of projects.

An error while passing a honeybadger Client type into <ErrorBoundary> component, it expects HoneyBadger

Temporary workaround I've implemented:

import ErrorBoundary from '@honeybadger-io/react';
import React from 'react';

import honeybadger from '../lib/honeybadger';

import type Honeybadger from '@honeybadger-io/js';

const App = (): JSX.Element => {
  return (
    // eslint-disable-next-line total-functions/no-unsafe-type-assertion
    <ErrorBoundary honeybadger={honeybadger as Honeybadger}>
      <>
        <Component>
      </>
    </ErrorBoundary>
  );
};

Full error text:

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)

from honeybadger-react.

subzero10 avatar subzero10 commented on June 13, 2024

Hey @JustFly1984 , can you please try installing branch and let us know if you still experience the issue?

npm command to install a specific branch:

npm install@honeybadger-io/react#fix-ts-definitions --save

Thanks!

from honeybadger-react.

joshuap avatar joshuap commented on June 13, 2024

@JustFly1984 this should now be fixed in @honeybadger-io/[email protected]

from honeybadger-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.