Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [react-query]

React Query is hooks-based library for integrating data fetching into React function components

0 votes
0 answers
14 views

Why does React handle a 401 error at updateDehydratedSuspenseComponent?

Problem In the Developer Tools Network tab, all requests are 2xx success. I can get Valid data from server But, 401 error occurs.(this api is not mocked api.) react-dom.development.js:17497 ...
nayounsang's user avatar
1 vote
1 answer
16 views

useQueries loses the ability to query data in parallel because Next.js requires server component to be async

The app is running by Next.js. I have a useQueries hook: const userQueries = useQueries({ queries: user.contacts.map((contactId: string) => ({ queryKey: ['contact', ...
Skatoro's user avatar
  • 33
1 vote
1 answer
9 views

What do these numbers represent in React Query Devtools?

I've been wondering what these numbers represent in React Query Devtools. I searched online, but I can't find it's meaning. I thought cache ID. But I see duplicates. The total number of rows with the ...
jersey-ninja's user avatar
  • 1,148
0 votes
0 answers
67 views

React Query v3 to v4

We are trying to migrate from react. query v3 to react query v4. Following same code is working differently in v3 and v4. Basically, We have a custom hook which uses useMutation to do update in ...
ajm's user avatar
  • 13.2k
4 votes
1 answer
41 views

React query - force querying new data for a new object id

I'm using react query to fetch data on a blog post, according to its Id. When I visit a certain blogpost and then navigate to another one, it first presents me the data from the previous blogPost, and ...
Ofir's user avatar
  • 43
1 vote
1 answer
27 views

Getting this error "no overload matches this call" using "useInfiniteQuery" with React

I need help figuring out why my code isn't working and I keep getting this error: No overload matches this call. Overload 1 of 3, '(options: DefinedInitialDataInfiniteOptions<FetchResponse<...
Razieh's user avatar
  • 13
0 votes
0 answers
36 views

React Query queryClient.setQueryData isn't updating the cache data

I have a custom hook that looks something like this: export const useDeleteAccount = () => { const queryClient = useQueryClient(); const result = useMutation( async (accountId: any) => { ...
ajm's user avatar
  • 13.2k
0 votes
1 answer
32 views

Tanstack-Query Caching Not Working When Calling fefetch

I'm using @tanstack/react-query in my React Native (Expo) & Firebase project. I have set everything necessary (such as QueryClientProvider). For an unknown reason chrome networking tab doesn't ...
Vusal Huseynov's user avatar
-1 votes
0 answers
18 views

How can I use mutationfn with a reusable API file

import axios from "axios"; const axiosInstance = axios.create({ baseURL:"https://jsonplaceholder.typicode.com" }) class APIClient<T> { endpoint: string constructor(...
Razieh's user avatar
  • 13
0 votes
0 answers
25 views

React-query sometimes render with no uses value and i don't know why

I try to make infinite scroll. And i found out sometime react query fetch twice. for example, it should fetch only second page, but some time fetch second and third pages. (I'll call this a bug in the ...
PARKGEONTAE's user avatar
0 votes
0 answers
36 views

⨯ TypeError: react__WEBPACK_IMPORTED_MODULE_2__.useContext is not a function

I am working on a Next.js project where I am using TRPC and React Query for data fetching. However, I am encountering a TypeError: useContext is not a function error. Here is my setup: TRPC Client ...
Deepansh .i's user avatar
-1 votes
0 answers
28 views

Does useFormState/useActionState React hook handle multiple requests gracefully like TanStack react-query?

TanStack react-query does a good job handling scenarios where the same request is made multiple times before getting a response. Does React's useActionState (originally called useFormState) hook ...
Snap's user avatar
  • 647
1 vote
0 answers
30 views

How to build an isomorphic API client with dynamic headers in next js?

I have a next js application with a separate API. All API endpoints require a specific X-HOST request header. I want to prefetch requests on the server side and sometimes invalidate them on the client ...
Vasyl Bielokopytov's user avatar
0 votes
0 answers
29 views

Why does my handle click not working when resetting field to empty?

I created an update function wherein there is a specific function in my radio button wherein if the user selected no/none it will reset the other form into empty string or make it null, but the ...
Stykgwar's user avatar
  • 577
-4 votes
0 answers
41 views

I need help about how should use mutation fn in the react project [closed]

I am new in coding and try to learn react. I try to usemutation hook for my component and in this I need a mutation fn, where I face this Error: No overload matches this call. The last overload gave ...
Razieh's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
122