I am just writing to text input and in onChange event i call setState, so React rerenders my UI. The problem is that the text input always lose a f
My answer is similar to what @z5h said.
In my case, I used Math.random() to generate a unique key for the component.
I thought the key is only used for triggering a rerender for that particular component rather than re-rendering all the components in that array (I return an array of components in my code). I didn't know it is used for restoring the state after rerendering.
Removing that did the job for me.