Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda