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

200
Views
En el componente de reacción, location.href no parece redirigir

Tengo un escenario muy simple en el que necesito redirigir a un dominio externo para reaccionar algo como esto al cambiar un interruptor:

 handleSwitch={() => { location.href = 'https://www.google.com/'; // oldAppUrl; // window.open(oldAppUrl, '_href') }}

Sin embargo, esto no está funcionando. ¿Qué me estoy perdiendo?

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

0

Prueba así:

 window.location.href = 'https://www.google.com/';

y esto también debería funcionar, usándolo en una aplicación:

 window.location = 'https://www.google.com/';

Si ninguno de estos dos funciona, significa que su función handleSwitch probablemente no se haya llamado, entonces debería mostrarnos más código para ayudar con la solución.

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!