We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello!
When updating to tanstack query v5 there is a relevant breaking change to consider: https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose
=> onSuccess and the other callbacks will not be available.
In our case, we are currently using the onSuccess of a atomWithQuery to set another atom, something like this:
const loadAndCacheUnitAtom = atom(null, async (get, set, { unitId, onSuccess }) => { const [loadUnitAtomTwo] = atomsWithQuery((g) => { return { queryKey: ['units', unitId], queryFn: async () => query(spaceId, payload), onSuccess: (data: any) => { if (onSuccess) { const { units } = data; set(setUnitsMapAtom, units); } }, }; }); return get(loadUnitAtomTwo); });
the ugly alternative for this in react query when you really need to sync your store is to use useEffect:
How can we get the same result here and properly do a set to another atom on query sucess?
Thanks!
The text was updated successfully, but these errors were encountered:
Related: #42 WIP: #45
You are welcome to join this effort.
Sorry, something went wrong.
No branches or pull requests
Hello!
When updating to tanstack query v5 there is a relevant breaking change to consider:
https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose
=> onSuccess and the other callbacks will not be available.
In our case, we are currently using the onSuccess of a atomWithQuery to set another atom, something like this:
the ugly alternative for this in react query when you really need to sync your store is to use useEffect:
How can we get the same result here and properly do a set to another atom on query sucess?
Thanks!
The text was updated successfully, but these errors were encountered: