-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #8012 where a race condition with useEffect was causing stale renders of values. #8022
Conversation
|
0b7a713
to
17b1383
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think useLayoutEffect
is an improvement, but I wonder if we can eliminate the onNextChange
listening gap completely? Thoughts below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding that <StrictMode>
test.
004e9ee
to
eaffe84
Compare
Fixes
#6699 (maybe)
#7694
#7896
#8012
A race condition with useEffect was causing stale renders of values when reactivevars were called multiple times synchronously.