Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!