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

108
Views
React V6 having issues navigating from Class component

After making the changes required by react-router-dom 6, it seems like we no longer receive props from the dom, hence I am no longer able to navigate and pass params this way.

    this.props.history.push({
      pathname: "/search",
      state: sessionStorage.getItem("user"),
    });

I read that an alternative to that was to use useNavigate and it was possible to wrap a class component inside a function and export it as such:

// Wrap and export
export default function (props) {
  const navigation = useNavigate();
  return <login {...props} navigation={navigation} />;
}

This seems too hacky and did not work. anyone is using navigation with passing parameters in Dom v6? how is it done?

Thank you

about 4 years ago · Juan Pablo Isaza
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!