FortAwesome / react-fontawesome

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

TypeScript error when styling pro duotone icons #509

Open Jxyme opened 2 years ago

Jxyme commented 2 years ago

Describe the bug When styling the pro duotone icons I receive a TypeScript error in the code editor (as shown below), even though the styles applied are displayed as expected when viewed in the browser. I have provided a basic test case below so you're able to reproduce the case for yourselves.

NxWDYECB

Reproducible test case

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faEclipse } from '@fortawesome/pro-duotone-svg-icons'

export default function Example() {
  return (
    <FontAwesomeIcon
      icon={faEclipse}
      style={{
        '--fa-primary-color': '#FFFFFF',
        '--fa-primary-opacity': '1.0',
        '--fa-secondary-color': '#000000',
        '--fa-secondary-opacity': '1.0',
      }}
    />
  )
}
{
  "dependencies": {
    "@fortawesome/fontawesome-svg-core": "^6.1.1",
    "@fortawesome/pro-duotone-svg-icons": "^6.1.1",
    "@fortawesome/react-fontawesome": "^0.1.18",
  },
}

Expected behavior There shouldn't be any TypeScript error when applying the individual colour styles for the pro duotone icons.

Desktop (please complete the following information):

JshGrn commented 1 year ago

+1 also getting this error