I am trying to redirect when a button is clicked but is not working. I did a console log on the handleClick event and it did log in the console. Here is the code and I am not sure where did I go wrong? Thanks in advance.
import React from 'react'
import { Redirect } from "react-router-dom";
const Home = () => {
function handleClick() {
return <Redirect to='/aboutus' />
}
return (
<div>
<button type="button" onClick={handleClick}>
Go About Us
</button>
</div>
)
}
export default Home