FortAwesome / react-fontawesome

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

Type 'IconDefinition' is not assignable to type 'IconProp' #470

Closed ChristopherMeek closed 2 years ago

ChristopherMeek commented 2 years ago

This seems to be a duplicate of #462, but I've just updated everything in my project to v6

Versions "@fortawesome/free-brands-svg-icons": "^6.0.0", "@fortawesome/free-regular-svg-icons": "^6.0.0", "@fortawesome/pro-duotone-svg-icons": "^6.0.0", "@fortawesome/pro-light-svg-icons": "^6.0.0", "@fortawesome/pro-solid-svg-icons": "^6.0.0", "@fortawesome/react-fontawesome": "^0.1.17",

The following example given me the error. Is this just a case of the @fortawesome/react-fontawesome package, totally understandably, lagging a few hours behind the 6.0 release of everything else?

import { faSave } from "@fortawesome/pro-light-svg-icons"

function Component() {
  <FontAwesomeIcon icon={faSave} />
}
ChristopherMeek commented 2 years ago

Update, manually adding @fortawesome/fontawesome-svg-core seemse to fix the problem. It brings in v1.3 and I think the react-fontawesome library only brings in 1.2.32. So i'm guessing this will be fixed when react-fontawesome is updated for the v6 icons libraries

duhaime commented 2 years ago

I needed to replace all my versions with "latest" to please typescript:

    "@fortawesome/free-brands-svg-icons": "latest",
    "@fortawesome/free-regular-svg-icons": "latest",
    "@fortawesome/free-solid-svg-icons": "latest",
    "@fortawesome/fontawesome-svg-core": "latest",
    "@fortawesome/react-fontawesome": "latest",
victorsmits commented 2 years ago

Same issue with latest version

robmadole commented 2 years ago

Can you all try upgrading to 6.1.1? I think we've got this fixed.

TiTnOuK commented 2 years ago

I confirm that version 6.1.1 fixes the problem. Thanks!

acelaya commented 1 year ago

This issue seems to be back with v6.2.0

robmadole commented 1 year ago

@acelaya I can't reproduce this. Can you provide one?