My app behaves differently when production turned on!

SDK Version: 40.0.0
Platform: Android

I tested my app which is basically a really simple graphical kind of thing, which takes text inputs, puts the values in an useState array and after the user confirms it, another one can be added. The way it works is that the app pushes an empty object to the array and for the time of editing, it only modifies the last array item.

The problem: When confirming in the developer mode, the app behaves normally and adds a new item which I can modify. On the production build however, when I confirm it and start writing to the text fields, on every change the previous item gets added AGAIN? It’s really weird and I found out only after build. So it looks like useState behaves differently on production? How can I fix that. Thanks in advance