1、首先安装React脚手架
npm install create-react-app -g
2、用create-react-app脚手架创建typescript模板
create-react-app my-app --template typescript
3、安装react-app-rewired以及cross-env
npm install react-app-rewired cross-env
4、引入Ant-Design
yarn add antd
修改src/App.tsx,引入antd的按钮组件
import React, { FC } from 'react';
import { Button } from 'antd';
import './App.css';
const App: FC = () => (
<div className="App">
<Button type="primary">Button</Button>
</div>);
export default App;
修改src/App.css,在文件顶部引入antd样式
@import '~antd/dist/antd.css';