简体   繁体   中英

Using antd after initializing app with CRA

Here is my case: I initialized a project using create-react-app and I just figured out that using antd will be difficult. I followed the steps in the dedicated part on ant design web site and it doesn't work. I tried to eject my project but when I do I have an error 'config' already exists in your app folder (I don't know what is that config). I can't make ant working. I tried to add a simple button with the ant style but in the browser the button is a basic html button. My question is: is there a way to use antd after creating a react application using CRA ? I've read a lot of stuff on internet but accordingly to these posts and commentaries, nothing seems to work. Should I create a new project ?

Thanks a lot !

Ok I found the solution. I followed the steps here ant.design/docs/react/use-with-create-react-app and my mistake was installing babel-import-plugin globaly instead of directly in the project. So everything seems to work now. Sorry for that and thanks @iagowp for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM