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

167
Views
Estoy enfrentando un error de "Error de tipo: no se pueden leer las propiedades de undefined (leyendo 'push')"

Me he enfrentado a este problema al usar history.push('/pathname') en el componente app.js. mi requisito es que tengo que usar este history.push dentro de un controlador onclick definido en el componente app.js que luego se envía al componente de botón a través de accesorios. No soy capaz de averiguar la solución de este error. (El componente del botón es AppointmentNextBtn). Por favor guíame.

 import { useHistory } from "react-router-dom"; function App(){ const history = useHistory(); const onClickNextDateHandler = () => { history.push("/selectlocation/appointment/selectdate"); console.log("date button runs"); setNextBtnState("time");

};

 return( <Route exact path="/selectlocation/appointment"> <Toappointmentcontainer postAppointmentRequest={postRequestAppointment} /> <div className="btnwidget"> <AppointmentNextBtn onClickDateHandler={onClickNextDateHandler} displayState={nextBtnState} text="Next" button="button" /> </div> </Route>

)

 }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No puede usar el historial en el mismo archivo que declara su ruta. Los objetos de historial nunca estarán disponibles en este caso. La mejor manera es hacerlo directamente en citaNextBtn.

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