-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[v3] Concurrent mode broken #1536
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
Comments
When I set |
Sorry I should have been more precise. Render count goes up to a thousand. Press the button twice with some delay between. Might require a few tries. |
Updated codesandbox link, it was using I humbly suggest you take your time with this bug, it looks really nasty. 😅 |
Maybe |
|
Let’s keep in mind that CM is experimental still, so while it may be important and of high interest to those testing it out, it’s definitely not a serious issue or high priority. I want to set expectations correctly that there is zero obligation for anyone, especially core contributors, to pour hours of work into this issue unless it is something that affects or interests you directly. We will continue to monitor this issue as CM solidifies and better patterns emerge around it. |
@tannerlinsley to be clear when I say "must be fixed", I mean it solely from a "product" pov, as in "the bug comes from here and there is no work around", I do not imply any moral obligation for anyone here. |
You’re totally fine 👍 I triage conversations like this every day, so it’s always safer to set firm expectations, even if they are already being met :) |
The reason why I'm suggesting that it might be because of how |
Thanks @boschni ! My thoughts in random order:
I think we could either try to revert the behaviour to latest working behaviour ( |
What's the status here? |
@tannerlinsley https://codesandbox.io/s/wizardly-rubin-tx1hn |
Think I have narrowed it down to the following pattern: https://codesandbox.io/s/gallant-ritchie-o6wig?file=/src/index.js Don't know the exact details, but my feeling is that React is rendering the component in multiple trees with different props. Because all trees share a single observer instance, the observer keeps on switching between queries and triggering state updates. This has probably been introduced by: #1449. The main issue is that people expect the state returned from hooks like Currently the hooks are violating this rule because:
Either we'll need to find a clever way to work around the issue (like guessing what the next state would be), or we'll need to accept that the state can lag behind the options. Will dig into it a bit more. |
Interesting advice from @gaearon here about "pure" rendering: |
Concurrent mode useQuery re-rendering too many times bug
To Reproduce
https://codesandbox.io/s/interesting-architecture-g4ojv
Press
+1
a few times quickly and look at the number of renders.Closely related to #1482
The text was updated successfully, but these errors were encountered: