import React, { Component } from 'react'
import { Link } from 'react-router-dom'
export class Temp extends Component {
render() {
const RedirectFunc = () =>{
// Logic to redirect to cart page
// Some other login i want to use before the page gets changed thats why i cant use Direct link
console.log("I got click")
}
return (
<div>
<button onClick={()=>{RedirectFunc()}}></button>
</div>
)
}
}
export default Temp
How can i redirect my self to a page using a onclick functionality in react class based componenet the reason why i cant use Link is that i had to do some other logics as well before i move to other page