history.push js code example
Example 1: javascript window.history.pushState
window.history.pushState("http://example.ca", "Sample Title", "/example/path.html");
Example 2: history.push
// usually all you need
<Link to="/somewhere"/>
// but you can use a location instead
const location = {
pathname: '/somewhere',
state: { fromDashboard: true }
}
<Link to={location}/>
<Redirect to={location}/>
history.push(location)
history.replace(location)
Example 3: history.pushstate
history.pushState(state, title[, url])