Nested useSnapshot can fail a consistency check, triggering duplicate render invocations #890
-
The scenario here is pretty simple. Two components each using
The observed behavior when I've traced the internal behavior fairly closely, and my understanding of what is going on is:
Attempted resolutionChanging the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Upon further experimentation the nestedness of the Since an even simpler replication turns out to be possible, I have trouble imagining that someone else hasn't stumbled across this before so I'll re-review existing issues and discussions to see if this is a known issue. |
Beta Was this translation helpful? Give feedback.
-
Hm, that sounds like a reasonable fix. I actually thought that uLE should be appropriate, but at that time the use of uLE is warned in SSR, so avoided.
Neither does useEffect. Would you be able to create a failing test case?
So, do you mean it fails even without nesting? |
Beta Was this translation helpful? Give feedback.
Done. Thanks for being so responsive!