danawoodman / react-fontawesome

A React Font Awesome component.
https://www.npmjs.com/package/react-fontawesome
MIT License
667 stars 72 forks source link

Unknown prop on <span> tag #37

Closed hazeledmands closed 7 years ago

hazeledmands commented 7 years ago

Hello! Thanks for this module, it's great! I have just one minor issue, which is that if I use any of the special params like spin, stack, pulse, etc, I get the following warning in my browser console:

<FontAwesome name='cutlery' spin />
Warning: Unknown prop `spin` on <span> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
    in span (created by FontAwesome)
    in FontAwesome (created by xyz)

I can work around this by doing the following:

<FontAwesome name='cutlery' className='fa-spin' />

...but that's a bummer, since the nicer syntax is half the reason to use this module. Seems like you could solve this by stripping all non-HTML-friendly properties from the provided ones before passing along to the tag. Thoughts?

danawoodman commented 7 years ago

@demands that's strange... shouldn't be the case. Let me investigate.

danawoodman commented 7 years ago

@demands it works for me. Have a look at the examples directory and see if you might be missing something in your setup.

ashnur commented 7 years ago

Same issue for me.