Closed lveillard closed 2 weeks ago
Related: #42 WIP: #45
You are welcome to join this effort.
This issue is stale. API has been changed to be closer to React Query.
To answer the question about setting, you should derive the atom rather than setting onSuccess.
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!