Optimistic updates in React Query 5 can be simpler by using the useMutationState
anywhere in the application to hook into a running mutation state and variables
https://tanstack.com/query/latest/docs/framework/react/guides/optimistic-updates#via-the-ui
I would love if tRPC exposed a api.createPost.useMutationState()
hook
useMutationState()
on my own and reconstruct the mutation key, but I understand this is an implementation detail and not exposed by tRPCapiUtils.createPost.mutationState()
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too