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

223
Views
Target child element with useRef (react)

So I have a dropdown menu with 7 elements and it looks like this:

const [isHidden, setIsHidden] = useState(false);
 return (
 <div className="menu">
    <div
      className="col-2"
      onMouseEnter={() => setIsHidden(true)}
      onMouseLeave={() => setIsHidden(false)}
    >
      <div className="wrapper">
        <li className="select-none bot_line">products</li>
      </div>

      <div className={isHidden ? "visible_bot_menu" : "hidden_bot_menu"}>
        <div className="left_menu">
        </div>
      </div>
 </div>

As I said, there are 7 elements, they all look like this with different content. But when I hover it, they all display the same content, how can I manage to target which content I want to display?

Some said to use the useRef hook but I can't manage to make it work so I just deleted the code.

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!