加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

typescript – dt~ react-router error TS2503:找不到命名空间

发布时间:2020-12-15 16:18:01 所属栏目:百科 来源:网络整理
导读:我尝试使用typings install –save –global dt~ react-router下载React-Router输入法定义,但我的代码仍然无法编译,因为typings / globals / react-router / index.d.ts引用的HistoryModule不存在. 早些时候我被推荐使用打字–save react-router,但是虽然这
我尝试使用typings install –save –global dt~ react-router下载React-Router输入法定义,但我的代码仍然无法编译,因为typings / globals / react-router / index.d.ts引用的HistoryModule不存在.

早些时候我被推荐使用打字–save react-router,但是虽然这包括可怕的“HistoryModule”,但它缺少React Router元素通常具有的属性的其他键输入定义(缺少Route元素道具的onChange属性) .我需要下载其他类似的东西以使其工作吗?另外,我如何判断是否需要下载多个其他全局类型定义以使另一个定义工作,因为我不知道任何方式并且如果全局类型定义依赖于其他类型,则typings命令似乎无法理解模块.

解决方法

从 https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9928

The CLI tells you that there’s been references stripped,it is up to the user to make sure they get installed. This is because references are not an adequate dependency system.
07001
typings install dt~react-router/history --global

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读