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

110
Views
Cómo navegar usando withRouter en reactJS mientras hace clic en el botón react-router 6.2.1

Cómo navegar usando withRouter en reactJS mientras hace clic en el botón react-router 6.2.1.

Estoy usando reaccionar "react-router": "^6.2.1","react-router-dom": "^6.2.1",

estoy recibiendo un error por

exportar 'withRouter' (importado como 'withRouter') no se encontró en 'react-router-dom'

Aquí está mi código.

 import React, { Component } from "react"; import { withRouter } from 'react-router-dom'; class myTab extends Component { constructor(props) { super(props); this.state = {}; } createNew = () =>{ this.props.history.push(`/new/`); } render() { return ( <div> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="container-fluid"> <button type="create" class="btn btn-primary" width="300" onClick={this.createNew}> New </button> </div> </nav> </div> ); } } export default withRouter(myTab);

Aunque estoy degradando el enrutador de reacción a 5.2, obtengo el mismo error.

Que opciones tengo para arreglar esto.

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!