react router onclick navigate code example
Example 1: navigating programatically react
import { Route } from 'react-router-dom'
const Button = () => (
<Route render={({ history}) => (
<button
type='button'
onClick={() => { history.push('/new-location') }}
>
Click Me!
</button>
)} />
)
Example 2: react window navigate
window.location.href = "/insert/your/path/here".