Skip to content

TS2322: Type "fa-regular fa-whale" is not assignable to type IconProp #572

@billsbooth

Description

@billsbooth

Describe the bug
Getting a TS Syntax error when using a string name in icon for regular style in React Native + Expo.

Reproducible test case

import { faWhale } from '@fortawesome/pro-regular-svg-icons/faWhale';
library.add(faWhale);

// TS2322: Type "fa-regular fa-whale" is not assignable to type IconProp
// index.d.ts(9, 3): The expected type comes from property icon which is declared here on type IntrinsicAttributes & Props
<FontAwesomeIcon  icon={'fa-regular fa-whale'} />

Expected behavior
Following the guidelines here, this should technically work.

Running RN on Expo:

"react": "18.3.1",
"react-native": "0.76.3",
"expo": "^52.0.11",

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions