75
rated 0 times
[
80]
[
5]
/ answers: 1 / hits: 7165
/ 3 Years ago, thu, december 16, 2021, 12:00:00
const test = () = {
const array = ['hello', 'myNameIs']
return (
{
array.map((arr) => (
<div>{arr}</div>
<button>Edit</button>
)
}
)
}
This .map() method is not working as I intended.
With the code, I was trying to get
hello [button]
myNameIs [button]
like this.
But when I actually render the code, I get
hello MynameIs [button]
In this kind of situation, How can I change the .map() statement?
Should I use an index?
More From » reactjs