score:2

Accepted answer

From the Github issue, find this comment

This is a known quirk due to the implementation details of concurrency in React. We don't cheaply know which of two versions is currently committed. When this ambiguity happens we have to over render once and after that we know that both versions are the same and it doesn't matter.

So we cannot help the component in question BUT we can help the children from not getting affected.

How?

Use React.memo.

The component children would therefore not get affected by the second, useless re-render.


Related Query

More Query from same tag