Closed streetlogics closed 3 years ago
Howdy @streetlogics 👋, are you using FontAwesome 5 or 4? If you're using 5, have a look at the official component: https://github.com/FortAwesome/react-fontawesome
If you're on 4, I would accept a PR to support forwardRef
in this repo but I'm not actively developing this anymore.
BTW, this repo doesn't use Typescript so you shouldn't need to worry about that unless I'm misunderstanding.
lol 🤦 I have no idea how I went from looking at the source here - https://github.com/FortAwesome/react-fontawesome/blob/master/src/components/FontAwesomeIcon.js to filing the issue in this project. Thanks for the response, I'll go post this there! 👍
EDIT: Turns out someone already reported it to - https://github.com/FortAwesome/react-fontawesome/issues/199 .
@streetlogics haha no worries, I've done as much or worse myself! Have a good day! 🍻
I know this use case is specific to material-ui, but feels like the feature would be useful to have for other projects that use this.
Current use case:
This currently throws an error because
FontAwesomeIcon
doesn't accept aref
attribute that points to the stored ref for the rendered element. I dug through the source here and seems pretty straightforward to add using https://reactjs.org/docs/refs-and-the-dom.html#creating-refs, but I haven't used Typescript a lot, so figured it would be best to just submit this as an official "issue"/request. Here's the material-ui docs referencing the issue as well in case it adds any additional clarity - https://material-ui.com/guides/composition/#caveat-with-refs