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

Improve React Hooks (useQuery) performance #56

Closed
helciofranco opened this issue Mar 8, 2024 · 0 comments · Fixed by #55, FuelLabs/fuels-wallet#1127, FuelLabs/fuel-explorer#223 or FuelLabs/fuels-wallet#1129
Assignees
Labels
bug Something isn't working

Comments

@helciofranco
Copy link
Member

The problem we're facing involves too many unnecessary updates happening in our application.
This happens because of how @tanstack/react-query handles the properties that trigger updates.

Inside, they're using a Proxy to keep track of which properties will trigger re-renders.

But when we use certain code patterns, like spreading properties with "...", it tells the Proxy to watch everything, even if we don't need it.

Implement a useNamedQuery to fix it, keeping the same API usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment