logtrace / material-icons-react

Google material icons implementation for React
MIT License
24 stars 16 forks source link

className is broken #39

Open Wgil opened 6 years ago

Wgil commented 6 years ago

If you try to add the className prop the icon is not displayed. Instead, it shows the icon name.

alhaji-aki commented 5 years ago

I am also facing this problem currently... any fixes???

ChristopherHButler commented 5 years ago

I noticed something similar when trying to use the package with styled components. The issue seems to be in processProps when clsName is set it is done in the following way: const clsName = className ||material-icons ${sizeMapped} ${defaultColor} ${inactiveColor};

This creates a problem using styled components because even though I am not setting the className, styled components will set a className and this is picked up by material-icons-react.

changing this to: const clsName =material-icons ${sizeMapped} ${defaultColor} ${inactiveColor}; will get the icon to display.

KemikalGeneral commented 4 years ago

Bump... this is still an issue!

yhojann-cl commented 1 year ago

Any update for this?, have same issue.