primer / octicons

A scalable set of icons handcrafted with <3 by GitHub
https://primer.style/foundations/icons
MIT License
8.27k stars 827 forks source link

Update React components to use `React.forwardRef()` #910

Closed joshblack closed 1 year ago

joshblack commented 1 year ago

Currently our Icon components are exported as plain functional components. It would be great if we included support for forwarding refs through React.forwardRef(), however this is only available past React v16.3. Currently, the project lists React v15 as a peer dependency.

It seems like we have a couple of paths forward:

lesliecdubs commented 1 year ago

Open question that came up at PRC maintainer's sync: is there any issue with releasing this major change we would need to account for?

@colebemis has the most context on this repo and said it's a pretty safe breaking change to go ahead and make, but feel free to coordinate directly as needed.