Updating an Items in a list in React

Hi everyone, I just started learning firebase and I’m creating this simple CRUD app.I’m currently having issues with updating the list. I tried several implementation but instead of updating existing list, it creates a new item in the list

The codesandbox to the problem is below:
https://codesandbox.io/embed/1cnsy?codemirror=1