In react, I\'m trying with a onClick event add a new object (dictionary) with the id of the clicked object as a key (prevId).
When the first object is created, it wil