[英]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.这是我的情况:我使用create-react-app
初始化了一个项目,我刚刚发现使用 antd 会很困难。 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).我试图弹出我的项目,但是当我这样做时,我'config' already exists in your app folder
一个错误'config' already exists in your app folder
(我不知道那个配置是什么)。 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.我尝试添加一个简单的蚂蚁样式按钮,但在浏览器中该按钮是一个基本的 html 按钮。 My question is: is there a way to use antd after creating a react application using CRA ?我的问题是:在使用 CRA 创建 React 应用程序后,有没有办法使用 antd ? 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.我按照这里的步骤 ant.design/docs/react/use-with-create-react-app 我的错误是全局安装 babel-import-plugin 而不是直接在项目中。 So everything seems to work now.所以现在一切似乎都有效。 Sorry for that and thanks @iagowp for the help.抱歉,感谢@iagowp 的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.