FortAwesome / react-fontawesome

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

0.2.1 defaultProps migration introduces breaking change #562

Closed mmaloon closed 2 months ago

mmaloon commented 3 months ago

Describe the bug Release 0.2.1 introduces bug where explicitly passing undefined as a className causes an error

Reproducible test case Codepen Demo

Expected behavior This has potential to break existing code. Maybe revert and save for a major release?

This code works for version 0.2.0 but not on 0.2.1 <FontAwesomeIcon className={undefined} icon={faUser} />

mmaloon commented 3 months ago

Didn't realize there is already a pull-request discussing this issue: https://github.com/FortAwesome/react-fontawesome/pull/559

shehi commented 2 months ago

Regardless of any PRs, this issue should exist.

The usage of .split() function contradicts TS typing of className props which is nullable:

image

robmadole commented 2 months ago

Thanks, I'll take a look at this.

robmadole commented 2 months ago

Just released 0.2.2. Please give this a try.