-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
React 16.13.0 'Warning: Cannot update a component from inside the function body of a different component.' #600
Comments
Hey, Thanks for the accurate reproduction, this issue seems to be present in most state-management solutions judging from this facebook/react#18178 (comment) I'll follow this up more in the coming days. |
If I'm not mistaken, this can very easily be triggered. As far as |
Yeah, I find the warning very counterintuitive in this particular situation. If I have two components calling |
The error message itself feels kinda erroneous as well to me, let's state the following example
This errors out if the result is served synchronously from cache but the error states:
We aren't leaving the |
Thanks for the quick fix here, folks 🙏 |
I am facing this warning: cannot update a component ( forwardref(basenavigationcontainer) ) while rendering a different component can anybody please fix this? I will share my code. looking forward to a positive response. |
After upgrading to React 16.3, I notice a significant performance issue on pages where I have multiple components all querying the same cache value. This appears to be due to an issue with the
useQuery
hook and/or thecacheExchange
.Expected behaviour
A single network requests is made to populate the cache. Components render with cached value once available.
Actual behaviour
Performance absolutely tanks and the following message appears:
Warning: Cannot update a component from inside the function body of a different component.
This doesn't seem to be unique to
urql
— Apollo has a similar issue. I've forked and tweaked the Apollo example repo to useurql
instead ofapollo
. The same notes about when the issue manifests seem to apply.The text was updated successfully, but these errors were encountered: