Category "react-query"

Let TypeScript compiler know that the data is present in React-Query

React-Query generally returns some query states such as isLoading, isError. The library guarantees that these booleans are stable. This means we can be sure tha

How to fetch data only on first click via react-query and then disable refetch on subsequent clicks

I encountered a problem while implementing the form where the data used in select, retrieved from the database via react-query, should only be retrieved once wh

React-Query Prefetch query doesnt return value?

const getQueryService = () => { return { login: async (id): Promise<AuthLoginGoogleResponse> => { try { const result = await aut

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