Missing `title` TypeScript type
In the README, where the API is described, it indicates that a title property (string) will be accepted.
However, trying to specify that in a Next.js TypeScript project shows an error:
No overload matches this call.
Overload 1 of 2, '(props: QRCodeProps | Readonly<QRCodeProps>): QRCode', gave the following error.
Type '{ id: string; fgColor: string; size: number; level: string; title: string; value: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
Property 'title' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
Overload 2 of 2, '(props: QRCodeProps, context: any): QRCode', gave the following error.
Type '{ id: string; fgColor: string; size: number; level: string; title: string; value: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.
Property 'title' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<QRCode> & Readonly<QRCodeProps>'.ts(2769)
The interface defined here doesn't specify title.
https://github.com/rosskhanas/react-qr-code/blob/master/types/index.d.ts
@grempe I personally do not use TypeScript, would appreciate a PR 🙂
Actually, this shows an issue
https://github.com/rosskhanas/react-qr-code/blob/master/src/components/QRCodeSurface/index.native.js
The native component doesn't have a title prop being used.
While the web component, https://github.com/rosskhanas/react-qr-code/blob/master/src/components/QRCodeSurface/index.js does have
<title> and should probably be removed, as users can pass {children} to both components and have the same expected result.
Repo appears to be a bit broken where title is concerned.
import QRCode from 'react-qr-code' does not give a component that accepts title
Also, example should be a totally separate. (Importing QRCode from ../lib is unlikely to yield a functional codebase except on your local)
It might be that this repo needs tests to avoid further regression.