Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning about FontAwesomeIcon when using in Typescript file

I'm using NextJS with Typescript and when i'm import FontAweSomeIcon to use like this <FontAwesomeIcon icon={faCheck as any} /> it got this warning from console "Warning: FontAwesomeIcon: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead."

Can you guys help me to how to remove or fix that warning

like image 940
タインズン Avatar asked Dec 17 '25 12:12

タインズン


1 Answers

I was having the same problem. But, after updating each Font Awesome dependency, the error message was gone.

Execute the following in your terminal inside your project directory:

npm i @fortawesome/react-fontawesome@latest @fortawesome/fontawesome-svg-core@latest @fortawesome/free-regular-svg-icons@latest

Warning: this will install the latest version to each of these packages, so be cafeful because may break things.

like image 65
Bruno Avatar answered Dec 19 '25 06:12

Bruno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!