i want to loop in this array, and i don't have key in array
my array
const array = ['name1','name2','name3']
after that the proplem on console is
Warning: Each child in a list should have a unique "key" prop
my component
{
items.map((item) => {
return (
<div className="flex-shrink-0 py-1">
<button
key={}
onClick={() => onFillter(item)}
type="button"
className="... tailwind css"
>
{item}
</button>
</div>
);
})
}
i try to added math.random()
in key -> bad result
added number to array -> bad result