Skip to content
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 19 Cannot update a component (Component) while rendering a different component #3764

Open
3 tasks done
JoaoBGusmao opened this issue Mar 17, 2025 · 0 comments
Open
3 tasks done

Comments

@JoaoBGusmao
Copy link

JoaoBGusmao commented Mar 17, 2025

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

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant