I have been trying to redirect to ProductId Component when there is a click on div with a className= "card" <div className="card" onClick={()=>CallComponent(_id)}>
The function CallComponent is:
CallComponent = (_id) => {
console.log("Clicked");
<Link to="/productnew">
</Link>;
<Route path="/productnew" component={ProductId}></Route>
};
When there is a click on card "Clicked" is seen in the console but the component is not routed