react中使用TS

首先是安装TS依赖

1
npm install -S -D typescript

写的时候报错,类型“mapRequest”上不存在属性“setState”

再安装eact、react-dom的类型定义

1
npm install --save-dev  "@types/react"  "@types/react-dom"

报错

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.1.0rea

查看评论