How do I access onSuccess with TRPC client side?
We can do it with react query quite simply, but i don't see a documentation on it with trpc.
if the request is succesful i want to save the data to global state via zustand. I need the
onSuccess
to do it i believe.
this does not work
13 Replies
you can switch the undefined by the query props
thank you so much!!! ive been stuck on this for hours. where is information like this in the docs?
trpc client works on top of react query
i'm not that familiar with react query, thats my problem. thank you again, i got work to do. ππΎ ππΎ ππΎ
gl
one more question. why do we have the undefined as a first param
the first param is the query input
and you if use null it warns you
Argument of type 'null' is not assignable to parameter of type 'void | undefined'.ts(2345)
since we cant use devtools, thats why we pass undefined?
you pass undefined because the query doesnt need any input
specifically why its
undefined
idk
and you can use devtoolsDevtools | TanStack Query Docs
Wave your hands in the air and shout hooray because React Query comes with dedicated devtools! Γ°ΕΈΒ₯Β³
When you begin your React Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of React Query and will likely save you hours of debugging if you find yourself in a pinch!
GitHub
jobs/_app.tsx at main Β· STNeto1/jobs
Contribute to STNeto1/jobs development by creating an account on GitHub.
okay i got read up on react query, thanks for the resources.