Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
is there any way we can use button instead of link to redirect on different path
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

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!