FortAwesome / react-fontawesome

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

IconProp type not exported! #527

Closed erikbergsten closed 1 year ago

erikbergsten commented 1 year ago

Describe the bug To to create a component which uses a fontawesome-react icon in typescript you need the IconProp type from fontawesome-react! It currently isn't exported so you have to cast-as-any to pass typechecking (and my OPO will kill me if I do).

Reproducible test case Simple enough

import { IconProp } from '@fortawesome/react-fontawesome';

results in: TS2459: Module '"@fortawesome/react-fontawesome"' declares 'IconProp' locally, but it is not exported.

Expected behavior The type should be imported

Additional info snippet from package.json:

    "@fortawesome/react-fontawesome": "^0.2.0",
robmadole commented 1 year ago

Try import { IconProp } from '@fortawesome/fontawesome-svg-core';