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.


use react.memo.

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

Related Query

More Query from same tag