React: choose to which list an item should be added


I have the following problem: I can create a new list and add items to them. The items are added and rendered in all of the newly created lists.

Desired outcome: I would like to choose, to which list I can add my item. How to achieve this?

Any help is appreciatted.

I made a small code example: LINK Codesandbox

Hey there,

so what are your thoughts on this?
How would you solve this in real life, without all the technical stuff?

Well, thanks for the tip.
I would have two baskets, one with number 1 and the second numbered as 2. Then I would take an apple and choose the basket, to which I would like to put the apple in.

This means, that I would need to get the id or index of a newly created list and put/add the item into it. So first of all I need to get the id/index.

1 Like