会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
洛阳之晨,譬如临安初雨
博客园
首页
新随笔
联系
订阅
管理
2020年6月2日
tsx 编写react 遇见类型“Readonly<{}>”上不存在属性XXX解决办法
摘要: 这样的问题是TS语法类型检测的时候会报错,这时候可以给state个props生命类型,问题解决,代码如下: import React from "react"; type StateType = { name: string; number: number; }; type propType = {
阅读全文
posted @ 2020-06-02 11:04 洛晨随风
阅读(12822)
评论(0)
推荐(3)
编辑
公告