React 19 Cannot update a component (Component
) while rendering a different component
#3764
Open
3 tasks done
Describe the bug
Since react 19, there is an error showing up when trying to mount a component that runs a query that was already executed by another component.
I found this error while updating a website to next15. It has a page that calls a follow button that queries the followage status. The error shows up when navigating to a different page that imports the same button component.
I prepared two examples, one using nextjs, which is closer to my use case, and another one using
npx create-react-router@latest
.What I found out is that the error only happens when using network-only, and when the two query invocation has the same query name. (There's an extra page on next's example that test it). On nextjs, it happens regardless using network-only or not
create-react-router example:
https://github.com/JoaoBGusmao/urql-r19-bug
nextjs example:
https://github.com/JoaoBGusmao/urql-next15-bug
Both projects, just install the dependencies and run yarn dev
Reproduction
https://github.com/JoaoBGusmao/urql-r19-bug
Urql version
urql 4.2.2
Validations
The text was updated successfully, but these errors were encountered: