📌  相关文章
📜  反应路由器在刷新时删除位置状态 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:53.209000             🧑  作者: Mango

代码示例1
import createHistory from 'history/createBrowserHistory'

...

componentDidMount(){
    const history = createHistory();
    if (history.location.state && history.location.state.transaction) {
        let state = { ...history.location.state };
        delete state.transaction;
        history.replace({ ...history.location, state });
    }
}