Search code examples
reactjscreate-react-appantd

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 !


Solution

  • 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.