1,861 questions
-1
votes
0
answers
21
views
React Query data update works in dev but not in production (Expo Router, minified build) [closed]
I have a React Native app using Expo Router and React Query. I fetch a list of items using useQuery and display them in a FlatList. I also have a mutation using useMutation to add a new item.
In ...
0
votes
2
answers
97
views
React Query Server Side Rendering
I have been using react query and next.js , I need to know how can achieve server side rendering using react query, I can achieve with this using normal fetch or axios in the server side components, ...
0
votes
1
answer
92
views
How can I have a delay until useQuery/refetch have returned the data
I am developping an iOs/Android App with React Narive.
I am using useQuery (TanStack Query v5) to send the username and an hashed password to my database and it return the user ID if the email/...
0
votes
1
answer
170
views
Can Tanstack/React Query handle dynamic parallel queries that are computed based on earlier queries?
I see that Tanstack Query supports parallel queries in a certain way that is dynamic, per this page: https://tanstack.com/query/latest/docs/framework/react/guides/parallel-queries#:~:text=each%...
0
votes
0
answers
73
views
How to refetch react openAI react query queries
I am working on a react native app that is using openapi-react-query in order to enforce the type safety across backend and mobile, my struggle is how to refetch queries (in a component other than the ...
0
votes
1
answer
139
views
RefetchInterval, and QueryKey Changing, will this cause two network requests?
Really need some help understanding the nuances and effects of how refetchInterval, and queryKeys interact with each other.
Currently, I have a UI that is stuck on loading state. I suspect it is ...
0
votes
2
answers
52
views
How to make react-query wait till input data used in request is resolved with other API call?
I am using tanstack-query and have dependent queries to do:
const { resourceId } = useGetResourceId(); // resourceId: number | null
const { data, loading, error } = useGetResourceData(resourceId);
...
0
votes
1
answer
79
views
React-query isRefetching is triger loader in RefreshControl at first mount screen
In my react-native project, I use tanstack react-query: https://tanstack.com/query/latest/docs/framework/solid/reference/useQuery#isrefetching-boolean
Why is isRefetching executed if I don't call ...
0
votes
2
answers
129
views
How to refetch from a client component with useQuery
I have a client component that fetches the list of project and a dialog box that creates a project but I cant update the project list unless I have to do a manual refresh on the browser.
The flow is:
...
4
votes
0
answers
266
views
How to test useSuspenseQuery hook
Recently I read about new hook useSuspenseQuery provided in @tanstack/react-query v5.
Previously I have used useQuery and have written unit tests on it.
I am trying to write unit tests on ...
0
votes
0
answers
43
views
React query v4 optimistic updates
I have two media hide and unhide, I am using optimistic update approach from react query
It works smoothly, the setup of my react is list of checkbox, 1 list for hidden and 1 list for non-hidden items....
1
vote
0
answers
21
views
Navigation issue with multi step react form with react context updates
I'm building a multi-step order form using React, react-hook-form, and react-query. Initially, there are three visible steps: customer information, product selection, and order summary. Depending on ...
0
votes
0
answers
23
views
Infinite query fetchNextPage modifies first page's data
I have a mutation where I append a comment to the first page (pages[0]). In my onMutate, I cancel any ongoing refetches (if we're not fetching a subsequent page) and then refetch in onSettled
Mutation:...
0
votes
0
answers
45
views
"Error: No QueryClient set" when using TanStack Query in a component package across repositories in Next.js
I have a Next.js application (main-app) that imports and uses UI components (widgets) and API hooks from a separate repository (abc-widgets).
These widgets internally use API hooks that rely on ...
1
vote
1
answer
103
views
How to handle for a request that takes to long to download content using useQuery from React Query?
I'm using useQuery function from React Query to fetch data in my React application. However, I'm encountering an issue where some requests take too long to download content (about a minute).
Here's a ...
0
votes
1
answer
212
views
how to use React Query (TANStack) in next js server components?
A lot of people are saying that use React Query for efficient data retrieval. But to use useQuery hook I have to make every component "client component" then what would be the purpose of SSR ...
1
vote
0
answers
110
views
Managing Refresh/Cancel functionality in AG Grid Infinite Row Model
While migrating from the client-side row model to the infinite row model, my team and I are attempting to preserve the functionality of our custom Refresh/Cancel button.
In the client-side row model, ...
0
votes
1
answer
294
views
Why is react-query invalidation bleeding across tabs?
I have 2 instances of storybook running an application locally. I have 2 tabs open on localhost:6006 and localhost:6007, and I log in as a different user on each.
I do things in 1 tab that ...
3
votes
2
answers
778
views
Handling two cache keys for the same data in react-query
I have a Project type in my app. I need to be able to access it via two separate async function:
getProductBySlug
getProductById
At the root of the page I use the URL to derive the slug and query ...
0
votes
1
answer
459
views
Next js react query v5 useSuspenseQuery, 401 unathorized
I want to use useSuspenseQuery along with next js so that I can take advantage of the built-in React feature.
But when using useSuspenseQuery, it gives an error img
query
const { data, isLoading } = ...
0
votes
2
answers
88
views
Flattening an array causes UI freeze
I have an app with cards. Cards are fetched with useInfiniteQuery from React Query. I fetch new card each time I reach the end of the list.
Backend sends offset and limit based responses of this ...
0
votes
1
answer
652
views
Can I use TanStack Query as a replacement of client-side state managers such as Zustand or Redux?
Can I use TanStack Query with the below code example as a replacement of client-side state managers such as Zustand or Redux and therefore, have only one single state manager across the application?
...
0
votes
1
answer
69
views
How to trigger API call only when manual search, or page are changed in React Query?
I have search form, and i only want to call the api when selectedPage or resultsPerPage change or when user click on search after write some things in the form.
With this, the api is called when the ...
1
vote
1
answer
99
views
ReactQuery invalidateQuery doesn't work, UI updated with optimistic updates but data is not re-fetched
I use optimistic updates for the UI and it works, but the data is not re-fetched. In the server terminal I see only a DELETE request. There should be a GET right after it
queryClient.js
import { ...
1
vote
1
answer
223
views
Why is my React component occasionally stuck in an infinite re-render loop?
I have a React project where I am using React Query and TanStack Table. Occasionally, my component enters an infinite re-render loop, and I can't figure out why. Sometimes it works perfectly fine, and ...