Skip to content

Fix React ref type#903

Merged
thecrypticace merged 1 commit intotailwindlabs:masterfrom
alexandernanberg:fix-react-types
Jan 25, 2023
Merged

Fix React ref type#903
thecrypticace merged 1 commit intotailwindlabs:masterfrom
alexandernanberg:fix-react-types

Conversation

@alexandernanberg
Copy link
Copy Markdown
Contributor

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 thecrypticace merged commit f53375d into tailwindlabs:master Jan 25, 2023
@thecrypticace
Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants