question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement ant-design (antd) in create-react-app

See original GitHub issue

Hi guys. As you may know, ant-design is being sort of popular in these last days, but the implementation require eject CRA if you want to implement it in the best performant way.

More info:

Is there a way to implement ant-design, with no ejecting CRA?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:25 (11 by maintainers)

github_iconTop GitHub Comments

6reactions
gaearoncommented, Jun 5, 2017

I don’t understand why Ant docs recommend ejecting and using the Babel plugin. If I understand it right, you don’t need to eject to use Ant—you can import components one by one:

import Button from 'antd/lib/button';
import 'antd/lib/button/style';

This should work with Create React App.

cc @afc163, would you be willing to amend the docs to recommend this approach for CRA integration rather than ejecting? It’s unfortunate when libraries prescribe people to change their build process.

4reactions
MrLohcommented, Jun 7, 2017

See example less theme here: https://github.com/MrLoh/nextjs-cms/blob/master/static/antd-theme.less

Which is compile with lessc --clean-css static/antd-theme.less static/antd.min.css

You’d have to adjust the directory structure of course in create React app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use in create-react-app - Ant Design
create -react-app is one of the best React application development tools. We are going to use antd within it and modify the webpack...
Read more >
Use in create-react-app - Ant Design
create -react-app is one of the best React application development tools. We are going to use antd within it and modify the webpack...
Read more >
Use in create-react-app - Ant Design Landing
create -react-app is one of the best tools for React development in the industry. This article shows how to use Ant Design Landing...
Read more >
Getting Started - Ant Design
Ant Design React is dedicated to providing a good development experience for programmers. Before starting, it is recommended to learn React and ES2015...
Read more >
Ant Design of React
Import in Browser ... Add script and link tags in your browser and use the global variable antd . ... , or unpkg....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found