Category "react-query"

React useQuery called multiple times when dropdown is opened

I am using "react-query" to call an API from a component . For the purpose of this question , I am returning a mock response from the API . Every time , I open

How to use React Query's useQuery to fetch data with query params from an onSubmit function in a Formik form

I'm really new to React-Query so I an facing this issue. Here's the scenario. I have a component with a Formik form in it. It has a table with the list of data

How can I stop a react-query useQuery running on a refetchInterval when a condition is met?

I have a requirement to keep fetching data until a condition is met I can set up the fetch on an interval with the snippet below but I can't figure out how to s

useInfiniteQuery but all the data re-rendered every refetch

I'm trying pagination by useInfiniteQuery in React Query, it's refetch data perfectly, but there's a problem that each time new data added, the page re-render a

react-query how to call mutate from custom useMutation hook in Jest test

I'm running a React Native project where I'm testing custom hooks written with react-query. I'm using Jest, @testing-library/react-hooks and @testing-library/re

React JS React Query's useMutation: Unable to retrieve the response from the server within the onError callback

I am working on a React JS project. I am using React query, https://react-query.tanstack.com/ to make API requests. I am now having a problem with mutation retr

React query mutation: getting the response from the server with onError callback when the API call fails

I am working on a React JS project. In my project, I am using React query, https://react-query.tanstack.com/docs/guides/mutations. I am using mutation to make t