javascript - 打字稿扩展历史对象自定义状态属性
问题描述
import { history } from 'history';
history.push('my path', {
someNewProperty: true
});
然后当我尝试访问它时
history.location.state.someNewProperty
我有Object is of type 'unknown'.
错误。如何将自定义添加someNewProperty
到history.location.state
?
解决方案
推荐阅读
- javascript - Onclick 在第三方表单 iframe 中填写表单字段
- networking - Netplan 错误:无法绑定到端口 2893,地址已在使用中
- html - 由于未知原因,圆锥梯度 css 在 React 中不起作用
- mysql - MySQL 左/右/外连接
- python - 使用 Django 的 ORM 聚合 OneToMany 关系中不同日期的数量
- javascript - mongodb函数currentOp()的返回记录在哪里?
- sql - 如何将选择查询的结果放入 postgresql 中的函数
- php - 打开引导模式后,我的 php 变量被重置
- c++ - 如何基于循环迭代器选择函数
- android - Android 导航组件重新创建底部导航片段