OnSuccess alternative
Hello, I just stared using the react-query library (completely new to JS) and I just saw that I am using a callback which will be removed from the library. I am using the
As you can see I am using the
onSuccesscallback like this:As you can see I am using the
useQueryClient and the useNavigate hook (the latter from react-dom) and a custom hook for unified toast messages. My CreateProduct function is in a separated file and is its own function in order to be unit testable etc.. How would I achieve the same results without the onSuccess callback?