FortAwesome / react-fontawesome

Font Awesome React component
https://fontawesome.com
MIT License
3.67k stars 264 forks source link

Use forwardRef rather than custom `forwardedRef` prop #503

Closed cpmsmith closed 2 years ago

cpmsmith commented 2 years ago

Closes #199.

As discussed in the issue, this is a breaking change.

This branch is based on #502, which can be merged separately.

robmadole commented 2 years ago

@cpmsmith ok this looks great. So now I'm thinking about documentation.

Since forwardRef was introduced in React 16.3.0 it seems like we can create a little table that describes what version of react-fontawesome you need based on the version of React. Something like this?


react-fontawesome now supports forwardRef for version 0.2.x or above. This was a breaking change so if you are using React older than version 16.3.0 choose the 0.1.x version of this component.

Compatibility

React version react-fontawesome version
< 16.3.0 0.1.x
>= 16.3.0 0.2.x
cpmsmith commented 2 years ago

@robmadole Yeah, sounds great to me!

cpmsmith commented 2 years ago

@robmadole Does this need anything more from me to be merged/released? I looked around for the website source, and didn't find anything—I assume it's private to you folks. Or did you mean we should put that table in this repo's readme?

robmadole commented 2 years ago

@cpmsmith no nothing more from you! I've just got a stack of stuff I'm workin through currently and I haven't made it down to this. I'll update the docs both in this repos README.md and on the fontawesome.com site. You are correct though the source code for our site is private so you won't find that anywhere. I hopefully can get to releasing this next week; or that's my goal.

robmadole commented 2 years ago

ok @cpmsmith I've got 0.2.0 released. I've also updated the README's on each branch to mention the difference between versions 0.1 and 0.2.

Thanks again for this work. Really appreciate it.

BasudevBharatBhushan commented 4 months ago

can we trigger click() event on fontawesome icons?