Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
Open New Tab When User Clicks on Link to External Website

I'm developing a recommendations application written in React, and want the user to be able to be sent to external websites when the component containing the website's information has been clicked.

Currently, I have a wrapper that, when clicked, pushes the new URL to the history object from the React library. The source code is shown below.

<VStack onClick={() => history.push(<url here>)}> 
     <inside of component>
</VStack>

Unfortunately, the URL is being loaded in the same window, but I want the user to remain on the website, in the original tab.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Update your onClick function to

 onClick={() => window.open(urlHere)}

see more of window.open here

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can perhaps try setting the target attribute to "_blank" in the Link tag itself.

example:

<Link to="/somewhere" target="_blank">anything</Link>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda