Javascript typescript扩展历史对象自定义状态属性
然后当我尝试访问它时Javascript typescript扩展历史对象自定义状态属性,javascript,reactjs,typescript,react-router,Javascript,Reactjs,Typescript,React Router,然后当我尝试访问它时 import { history } from 'history'; history.push('my path', { someNewProperty: true }); 我发现对象的类型为“未知”。错误。如何将自定义的someNewProperty添加到history.location.state history.location.state.someNewProperty
import { history } from 'history';
history.push('my path', {
someNewProperty: true
});
我发现对象的类型为“未知”。
错误。如何将自定义的someNewProperty
添加到history.location.state
history.location.state.someNewProperty