react-qr-code icon indicating copy to clipboard operation
react-qr-code copied to clipboard

Missing viewBox type in props

Open WhereCanI opened this issue 10 months ago • 1 comments

It is not possible to add viewBox as a property to React QR when you use TypeScript.

The error it gives is:

  Overload 1 of 2, '(props: QRCodeProps | Readonly<QRCodeProps>): QRCode', gave the following error.
    Type '{ value: string; size: number; viewBox: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
      Property 'viewBox' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
  Overload 2 of 2, '(props: QRCodeProps, context: any): QRCode', gave the following error.
    Type '{ value: string; size: number; viewBox: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
      Property 'viewBox' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.```

WhereCanI avatar Oct 20 '23 13:10 WhereCanI

For now it can be fixed by adding //@ts-ignore

WhereCanI avatar Oct 20 '23 13:10 WhereCanI