logtrace / material-icons-react

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

Error Prop-Types #21

Open DylanDenizon opened 6 years ago

DylanDenizon commented 6 years ago

Hi,

I've some issues in my react project.

Here is my code: <Icon icon="phone_iphone" invert={true} inactive={false} />

And, here are the error messages: Failed prop type: MaterialIcon: prop typeinvertis invalid; Failed prop type: MaterialIcon: prop typeinactiveis invalid;

I tried to put the properties, to remove them and to put the string values between braces but my mistakes are still there.

How can I solve this problem?

sithumn commented 6 years ago

Hi,

Following is a sample.

import MaterialIcon, {colorPalette} from 'material-icons-react';

<MaterialIcon icon="dashboard" invert />
<MaterialIcon icon="alarm_on" inactive />

What is Icon in your sample. You should use MaterialIcon.

Refer to README.md for examples.

Also there's a demo project in the repo inside the demo directory. Go to App.js in that and you will be able to see how the lib is used.

Hope this will solve your problem.

DylanDenizon commented 6 years ago

Thanks for your fast reply. I did try this way, but the issue remains the same. It occurs even when the attribute is missing.

sithumn commented 6 years ago

Hi @DylanDenizon,

I'm sorry for the long pause. Do you still find this issue. If you could share a sample project. I can look in to that.

Regards, Sithum