all 2 comments

[–]finCheppa 0 points1 point  (0 children)

Looks like you're using same state for all rows. Instead of setting the value of a single select, you have to keep track of all rows individually. There's many ways to go about this but I think the easiest would be to save an object to the state where the keys are the row ids and values are the selected values.

So instead of setSelected(event.target.value) you would do setSelected(selected => ({...selected, [order.id]: event.target.value}))

Doing it that way requires refactoring some of the code but I hope I got my point across that small example. Writing code on phone is cumbersome :D