tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.72k stars 1.28k forks source link

Fix React ref type #903

Closed alexandernanberg closed 1 year ago

alexandernanberg commented 1 year ago

Fix ref types for React

E.g. this should be valid

function App() {
  const ref = useRef<SVGSVGElement | null>(null)
  return <Icon ref={ref} />
}

Also changes React.ComponentProps<'svg'> to React.SVGProps<SVGSVGElement> which is what React internally uses for <svg> elements

thecrypticace commented 1 year ago

Thanks!