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

146
Visualizações
Difference between useRef and onBlur?

I am confused about the usages of useref and onBlur in JS...I need suggestions on when to use both of these and the functionality of them.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I don't think there's is much of a similarity between those two. useRef is a react hook whereas onBlur is an event handler.

userRef allows you to create mutable objects within a react functional component, so you can have a value that persists across renders. The hook returns an object with a current property where the mutable object reference lives. Usually it is also used to create a reference to the dom node of a certain element, and this way you can work imperatively with the dom node by doing for example yourRef.current.focus()

onBlur on other hand is an event handler that you can attach to elements (usually inputs) to call back on the event when the element loses focus. I think of blur as the opposite of focus.

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