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

Tanstack react query v5 #122

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Tanstack react query v5 #122

merged 1 commit into from
Nov 3, 2023

Conversation

jonathonhawkins92
Copy link
Collaborator

Some resources I've used when working on this:

  1. https://tanstack.com/query/v5/docs/react/guides/migrating-to-v5

  2. https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose

I've removed the explicit return type from the queries, and switched to passing the return value to the useQuery generic instead.

I also updated quite a bit of naming, they've changed the meaning of isLoading to be what isInitialLoading was; which is now deprecated, and added a new state/flag called isPending, this means that where before you aliased the variables as isLoading{Thingy} it's now is{Thingy}Pending which is more in line with your error alias is{Thingy}Error, though tbh I think in my own projects I will stop destructuring these values so that I can do Thingy.isPending ect.

Note - due to the way to codemod works I've had to build this on top of the code quality branch so that I could format after running it.

Copy link

vercel bot commented Nov 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
resilience-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 5:42pm

@jonathonhawkins92 jonathonhawkins92 changed the title Draft: Tanstack react query v5 Tanstack react query v5 Nov 3, 2023
Base automatically changed from 120-add-pre-push-code-quality-check to main November 3, 2023 17:35
Copy link
Member

@DinerIsmail DinerIsmail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I smoke tested lots of stuff on the dashboard and everything still works as expected. Merging 🚀

@DinerIsmail DinerIsmail merged commit c06a464 into main Nov 3, 2023
5 checks passed
@DinerIsmail DinerIsmail deleted the tanstack-react-query-v5 branch November 3, 2023 18:01
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

Successfully merging this pull request may close these issues.

2 participants