preactjs / preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
https://preactjs.com
MIT License
36.63k stars 1.95k forks source link

Preact is not working for tailwindcss & react-icons #4411

Closed tsolutionsx closed 3 months ago

tsolutionsx commented 3 months ago

Dear Support Team. How are you ?

I hope you help me about my problem. now I am working with tailwindCSS with React-Icons in Preact Project. but if I am going to use React-Icons, there are happening any mistake like attached Image.

image

How can I use tailwindcss with react-icons ?

I hope you help me please.

thanks

JoviDeCroock commented 3 months ago

Preact core leverages class rather than className, when you are using compat className will work however, this looks to be erroring because there is some aliasing going on in your TypeScript types as normally the compat intrinsicAttributes should contain className as well. You might need to check how your declaration merging is going.

Fwiw, it looks like both React as well as Preact intrinsicAttributes only contain the key property so not sure how they are adding this on top.

rschristian commented 3 months ago

Posted this on Slack too, but...

Doesn't look like it's a vallid issue. react-icons don't seem to take a className prop: https://github.com/react-icons/react-icons?tab=readme-ov-file#adjustment-css

tsolutionsx commented 3 months ago

Posted this on Slack too, but...

Doesn't look like it's a vallid issue. react-icons don't seem to take a className prop: https://github.com/react-icons/react-icons?tab=readme-ov-file#adjustment-css

but I used react-icons with className in other react project.

JoviDeCroock commented 3 months ago

Have you tried checking whether that previous project had non-up-to-date versions of things? That being said our minimum requirement is a reproduction, you are also duplicating issues as you are asking for help on both Slack as well as GitHub. We can't help you on both mediums as you are just duplicating effort, I'll close this one as it doesn't suffice with our minimum requirements and we can continue this conversation on slack.

rschristian commented 3 months ago

I would also guess you're using different versions, as, per those docs I linked, react-icons changed this in some version.

For the current setup anyhow, MdDeleteForever is of IconType and IconType doesn't take a className prop