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

215
Vistas
Use ScrollToTop in react (but not for every link - how to do it)

I need to use ScrollToTop, but not for every link. What is the best way to do this? Adding a function to every link where I want to use this function seems like the wrong way. I was also thinking about wrapping all components <ScrollToTop>(all components and routes)</ScrollToTop> and excluding only the places where I don't want to use it - just not sure how to do that. I've tried to find the answer, but I guess no one has asked this, or I can't find it.

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

0

If I understand your question, you can create a Higher order component which has this ScrollToTop functionality. See here

about 4 years ago · Juan Pablo Isaza Denunciar

0

Try it

let scrollToTop = () =>{window.scrollTo(0,0)}

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