Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

react-query: onError. What should I use instead?

I have the same problem as here react-query: onSuccess, onError, onSettled are deprecated. What should I use instead? . And the the proposed solution is good but what if I want to use the result of the error inside the component? What should I do?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

if your particular use case has something more complex, consider using useEffect with error in dependencies.

Here is the blog post about changes in tanstack/react-query:
https://tkdodo.eu/blog/breaking-react-querys-api-on-purpose#a-bad-api

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading