Answer the question
In order to leave comments, you need to log in
Getting the right attributes of dynamic elements in React?
Hello.
Please share your experience, who uses it how:
suppose something like this is performed in the render:
{items.map((item, key) => (
<div key={key} className="blaba-class" onClick={(e)=>alert(e.target.key)}>
//...
))}
Answer the question
In order to leave comments, you need to log in
You can put everything in a separate component. It is possible in the data-* attribute.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question