Since https://github.com/tailwindlabs/heroicons/pull/779, the title prop can be set to create an svg title element, but the react typings do not include that prop: since the the definition in the Icon.d.ts file doesn't include it:
declare function StarIcon(props: React.ComponentProps<'svg'>): JSX.Element;
The error message is Property 'title' does not exist on type 'IntrinsicAttributes & SVGProps<SVGSVGElement>'.
I think the vue types are working because it allows any HTMLAttributes through, so it's probably just a matter of adding a & {title?: string } to the react props...
-? `import * as React from 'react';\ndeclare function ${componentName}(props: React.ComponentProps<'svg'>): JSX.Element;\nexport default ${componentName};\n`
+? `import * as React from 'react';\ndeclare function ${componentName}(props: React.ComponentProps<'svg'> & {title?: string}): JSX.Element;\nexport default ${componentName};\n`
Since https://github.com/tailwindlabs/heroicons/pull/779, the
title
prop can be set to create an svg title element, but the react typings do not include that prop: since the the definition in the Icon.d.ts file doesn't include it:The error message is
Property 'title' does not exist on type 'IntrinsicAttributes & SVGProps<SVGSVGElement>'.
I think the vue types are working because it allows any
HTMLAttributes
through, so it's probably just a matter of adding a& {title?: string }
to the react props...