使用ts启动新的 create react app项目
yarn create react-app my-app --typescript
将ts添加到已经创建好的create react app项目中
yarn add typescript @types/node @types/react @types/react-dom @types/jest
PS:适用于
react-scripts@2.1.0及更高版本。

使用ts启动新的 create react app项目
yarn create react-app my-app --typescript
yarn add typescript @types/node @types/react @types/react-dom @types/jest
react-scripts@2.1.0及更高版本。