DEV Community

lucasfrutig0
lucasfrutig0

Posted on

1 1

Handle Map in React

Hi! I´m a beginner front end dev, and i have some work with react.
But i have a doubt with manipulate an element in a map render components.

The Problem

Change a msg variable in only one element in a map
So, i have this variable in a title element:
Alt Text

And when the button is pressed i call a function and try set the message in this way:
Alt Text

Obs: I use useRef hook to get el reference in the dom

So, anyone can help me with this?

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more