Answers for "remove reload in link react-router-dom"

3

link reload page react

//Go to link and refresh the page
<a onClick={() => {window.location.href="/something"}}>Something</a>
Posted by: Guest on December-26-2021
0

react router remove location state on refresh

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 });
    }
}
Posted by: Guest on November-12-2020

Code answers related to "remove reload in link react-router-dom"

Code answers related to "Javascript"

Browse Popular Code Answers by Language