showing results for - "remove state from location on page load in react router dom"
Niklas
17 Aug 2020
1import createHistory from 'history/createBrowserHistory'
2
3...
4
5componentDidMount(){
6    const history = createHistory();
7    if (history.location.state && history.location.state.transaction) {
8        let state = { ...history.location.state };
9        delete state.transaction;
10        history.replace({ ...history.location, state });
11    }
12}
13
Jona
18 Sep 2016
1history.replace('', null);