I'd like to import a few components from the Ant Design React CSS library
but I can't manage to get it working. I want to be able to import a single component without it messing up with the rest of my CSS
.
Here's what I've tried:
import Button from 'antd/lib/button';
import 'antd/lib/button/style';
===> does not import the style.
import Button from 'antd/lib/button';
import 'antd/lib/button/style/css';
===> works, but messes up with the rest of the App
I have tried to do what is written here, import AntD on demand:
===> does not work, does not import the style
My question: is there a step-by-step guide to do what I want?
I'm not the only one who wants to do that and has problems, here, a guy on Reddit, I found many others links and have tried every single thing, absolutely nothing worked.
Thanks!
import {Button} from 'antd'
import 'antd/lib/button/style';
worked for me...
what do you mean by
'===> does not import the style.`
???
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With