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

140
Vistas
is it anti-pattern to append .current after useRef in react

I've recently been debugging some old React code developed by my colleagues and noticed that they would declare some useRef's inside their functional components like this:

const refName = useRef(...).current;

This isn't the first time I've seen ref's declared like this in the React community, but it seems to be rare.

I can only assume that they've done this so that they only have to reference it by the variable name further down the line - as opposed to variableName.current.

So, this got me wondering: other than making the code a little bit cleaner, are there any clear downsides or benefits to declaring references this way?

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