-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Move when the callback of setState/forceUpdate is called #593
Conversation
Nice, this is clever. I'm not too worried about the nested loop since this only happens at the very end of each render pass, and often the number of pending component mounts there is small. I'm curious though - does this break setState() callbacks after the first mount? Seems like that loop is only for just-mounted components, whereas the setState() callback needs to be invoked for any update. |
From linked issue:
Why callback to From React docs:
For me, this only says that If this fix hurts something else or adds additional complexity then I don't it's worth it. If fix is going to be totally safe, then I'm okay with it. Also, it's a breaking change, so for Preact 9. |
I mean, if it was merged prior Preact 8 went to |
Agreed - if this ends up changing that timing we'd want a major bump. That said, I don't think major bumps are going to have the same scheduling and buildup going forward as they have in the past, they're just backwards-incompatible changes. |
This aims to solve #556. Not sure how I feel about the loop inside a loop. This does make the test pass though, so it should be a decent place to start from and iterate on if need be.