摘要: 这样的问题是TS语法类型检测的时候会报错,这时候可以给state个props生命类型,问题解决,代码如下: import React from "react"; type StateType = { name: string; number: number; }; type propType = { 阅读全文
posted @ 2020-06-02 11:04 洛晨随风 阅读(12822) 评论(0) 推荐(3) 编辑