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

133
Views
How to check which element is hovered using React 17.0.2

I am currently trying to make a webpage that displays multiple images, and when I hover on each image, they will display different text depending on the image. I was thinking of useState and useEffect, but I'm not entirely sure how to implement that. My current structure is that I have a list with an a tag and inside that i have an image.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You could probably use the built in onMouseEnter and onMouseLeave events and manage a state with an object containing an index of each image and its info through the events.

<img src={picture} onMouseEnter={() => //change the state} onMouseLeave={() => //return state back to default}></img>
about 4 years ago · Santiago Trujillo Report
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!