yarn add antd //安装组件
导入组件
//index.js
import React from 'react';import ReactDOM from 'react-dom';import App from './App';import 'antd/dist/antd.css' // 样式一定要配置在入口文件中ReactDOM.render(<App />, document.getElementById('root'));
使用
在App.js中
import React from 'react';import {Button} from 'antd' // 先引入function App() {return (<div className="App">hello world<Button>ant</Button> // 在使用</div>);}export default App;
