Skip to main content
Filter by
Sorted by
Tagged with
Best practices
0 votes
0 replies
26 views

I prepared an interactive/editable single file expo-snack example that you can run in the browser (or simply download the expo go app on your phone, scan the QR code and you're ready to go) I have a ...
AndrewHoover898's user avatar
1 vote
1 answer
98 views

I am trying to implement infinite scrolling in a React (Next.js) application using Tanstack Query (useInfiniteQuery) and the IntersectionObserver API. I understand the basic idea of fetching paginated ...
agentAI's user avatar
  • 13
1 vote
1 answer
46 views

To migrate from React-Query V3 to V5 (Tanstack/React-Query), I have to change my usage of the lib because of one breaking change: undefined isn't an allowed return value for queryFn anymore. That's ...
JohnTitour's user avatar
1 vote
1 answer
1k views

I am currently exploring TanStack Start (with React). At What are Server Functions? page we have example of server function that can be used with useQuery (from TanStack Query, to fetch data from ...
Michał Turczyn's user avatar
0 votes
0 answers
51 views

I have an issue where I need to make 3 chained POST calls using Tanstack Query. POST with query 1 If query 1 fails, stop If query 1 succeeds, make POST query 2 If query 2 fails, rollback query 1 If ...
Jeff Barnes's user avatar
0 votes
2 answers
186 views

I am developping an iOs/Android App with React Native. 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/...
popof's user avatar
  • 3
0 votes
0 answers
66 views

We're in an awkward situation needing to consume an API endpoint that is not built correctly. It returns pages of (unsortable) records without revealing beforehand how many pages there are in total. ...
Byofuel's user avatar
  • 448
0 votes
1 answer
276 views

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%...
Byofuel's user avatar
  • 448
0 votes
0 answers
27 views

Problem After uploading new trade files through an "Upload New File" dialog, the trade reconciliation table shows stale data from the previous upload instead of the updated data. The table ...
J_Max's user avatar
  • 45
0 votes
1 answer
102 views

I’m building a react native app using expo and I created a component called FlightList.tsx that fetches flight data using a custom hook useFlightList.tsx (which internally uses React Query’s useQuery)....
Mohamed Amine Bejaoui's user avatar
2 votes
0 answers
83 views

We are using TanStack query (Vue) for storing a lot of states in the local storage. But what happens if the local storage is full? Will it just discard the oldest query if we store a new query?
Fakerhardcore's user avatar
0 votes
1 answer
219 views

I have an authentication system. calling Api's using tanstack query. When logging in, signing up, and verifying email using the link, everything works fine. However, when I check the mutation's ...
Huzaifa Ahmed's user avatar
0 votes
1 answer
220 views

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 ...
samplecode3300's user avatar
0 votes
2 answers
65 views

I am using tanstack-query and have dependent queries to do: const { resourceId } = useGetResourceId(); // resourceId: number | null const { data, loading, error } = useGetResourceData(resourceId); ...
zmii's user avatar
  • 4,349
2 votes
1 answer
109 views

I am trying to create a sort of complex react/jotai game with a next.js frontend server router connected to an express/node.js backend server. I keep getting circular dependency issues. I tried using ...
OkayGift's user avatar
0 votes
0 answers
44 views

I am using @tanstack/react-table React Table in a Next.js application. Want to show a list of columns to select from to display in the display However, the columns displayed are the column IDs ...
Anuj TBE's user avatar
  • 9,932
0 votes
1 answer
391 views

I have a query that uses placeholderData: keepPreviousData. This means the query is in a hard loading state, with no placeholder data, on initial mount. Then, when the queryKey changes, it goes into a ...
Gavin Wahl's user avatar
  • 1,321
0 votes
1 answer
116 views

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 ...
IncognitoUser's user avatar
0 votes
0 answers
121 views

I have several requests to add and change data: const updateRwStationsQuery = (id: string, data: RwStationDto) => { return apiInstance<RwStationDto>(`/rwstations/${id}`, { method:...
Александр Кос's user avatar
0 votes
0 answers
33 views

Current Situtaion Part of my ReactJS app has a social section where users can post messages and reply to other messages. I have an API call that returns a list of posts, each post contains an id, ...
FriedBrain's user avatar
0 votes
0 answers
316 views

How to Properly Hydrate a TanStack Router + Vite SSR App Without Using TanStack Start? I'm trying to implement server-side rendering (SSR) in a TanStack Router + Vite React project without using ...
Mikołaj Paterek's user avatar
1 vote
1 answer
159 views

I use an infinite list for which I prefetch data on the app startup. Everything works great except for when I hit 404 error if, for example, I manually change the url to a wrong one. Then the whole ...
magrega's user avatar
  • 263
0 votes
2 answers
245 views

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: ...
aRtoo's user avatar
  • 1,874
-1 votes
1 answer
93 views

React Query not updating my list on first render My list is not updating when i come back after updating my list , but my api is returning updated data export default function App() { const [id] = ...
razer's user avatar
  • 134
1 vote
1 answer
316 views

I am having a dumb moment. I use Tanstack Query and Ky in my app to make requests and inject jwt tokens in them. Every time a request hits a 403 error, the request gets resent after acquiring a new ...
magrega's user avatar
  • 263
4 votes
0 answers
352 views

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 ...
Dhananjay Sakhare's user avatar
0 votes
1 answer
154 views

I’m using React Query to manage my queries, and I have a scenario where I need to invalidate a query with specific parameters. useQuery({ queryKey: ["users", { page: 2, pageSize: 20 }], queryFn: ()...
Omkar Khatavkar's user avatar
0 votes
0 answers
37 views

I have a React app with a profile outlet route, where the index is the 'products'. I also have a similar route called 'savedProducts'. The difference is that the 'products' page lists by outletparam (...
benericsi's user avatar
1 vote
0 answers
224 views

This stack overflow post talks about the when to use the mutation hook vs the useQuery hook. The gist of it was: If you're reading data: useQuery If you're creating/updating/deleting data: ...
Shakur Smith's user avatar
0 votes
1 answer
464 views

I am Vue developer for years , now I am trying to learn Reactjs and Nextjs. and I am implementing user list page that include pagination , I have some problem with that this is my code : "use ...
morteza mortezaie's user avatar
0 votes
1 answer
74 views

With my site I am using Tanstack react-query. Now caching seems to work when navigating between pages and I can confirm that by checking the network log and no extra calls are made. Now is it fair to ...
ScuffedCoder's user avatar
3 votes
0 answers
441 views

When using useInfiniteQuery in React Native environments (Android and iOS), the app crashes with the error: "observer.getCurrentResult is not a function (it is undefined)". This error does ...
Johanan307's user avatar
0 votes
1 answer
309 views

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 ...
Yaseen Jabir's user avatar
0 votes
1 answer
150 views

I'm using React with @tanstack/react-table and react-query to implement a paginated table with server-side filtering and sorting. I'm encountering an issue where selecting a date filter sometimes ...
Dev Pathak's user avatar
0 votes
1 answer
414 views

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 ...
Aaron Parisi's user avatar
0 votes
1 answer
1k views

I have a mutation that comprises of a sequence of long-running actions: useMutation({ mutationFn: async () => { await firstTask() await secondTask() await thirdTask() }, ... }) I ...
Undistraction's user avatar
3 votes
2 answers
965 views

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 ...
Undistraction's user avatar
2 votes
1 answer
963 views

Any idea how to add tanstack react-query to laravel 11 reactjs project? The apps.jsx looks like this const appName = import.meta.env.VITE_APP_NAME || 'Laravel'; createInertiaApp({ title: (title) =...
Tom Kur's user avatar
  • 2,440
0 votes
1 answer
586 views

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 } = ...
И И's user avatar
  • 1
1 vote
1 answer
182 views

If refetchInterval is set to 10 seconds in useQuery, and a given request takes 2 seconds to complete, will the next request be initiated 10 seconds after the start of the previous request, or 10 ...
Zirnael's user avatar
  • 13
0 votes
1 answer
513 views

I'm building an Expo React Native app using Expo Navigation (Stack Navigator) and React Query. When navigating between screens (e.g., from Home to Test screen and back), I need to refetch data when ...
robo's user avatar
  • 119
1 vote
0 answers
102 views

Problem Statement I'm experiencing intermittent failures with a PATCH API request that runs every 20 seconds in a React application. The failures return status code 0 and seem to persist for a long ...
r0k's user avatar
  • 11
1 vote
1 answer
108 views

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 { ...
Georgios 's user avatar
0 votes
0 answers
99 views

I am trying to implement hydration of tanstack query cache from server to client. During the server phase, some requests are cached. I want to re-use them in the client after hydration process. I am ...
radekdob's user avatar
  • 147
0 votes
1 answer
91 views

I’m developing a screen in React Native that lists books fetched from my API using TanStack Query. I’ve also implemented a search functionality that updates the results based on the entered text (...
Sansaa59's user avatar
0 votes
2 answers
1k views

Prerequisites NextJS 14+ Using server action Using app router React Query 5+ Zustand+ Question I wanted to come up with a design that takes advantage of the best of all the tech above. Imagine we ...
Jplus2's user avatar
  • 2,589
2 votes
1 answer
943 views

I'm using @tanstack/react-query with the useInfiniteQuery hook to fetch paginated data for a list of items. The infinite query works fine for normal pagination and scrolling. However, when I change ...
Eimantas Petrikas's user avatar
0 votes
1 answer
527 views

Really simple thing, if a URL parameter changes, previous data is no longer valid and should be cleared. However, when calling refetch from useEffect, useQuery doesn't do that. Is there some parameter ...
Mikhail Batcer's user avatar
0 votes
1 answer
55 views

It goes to the onError in the mutation, however in the try catch the next response has a status of 200 so it does not execute the catch method. What should I do so that if it goes to onError, it goes ...
Aurumen's user avatar
  • 15
2 votes
2 answers
418 views

I'm using React Query to fetch a list of users via the useQuery hook. When the fetch fails, I display an error message along with a retry button. When I call refetch, both isError and error are ...
Thore's user avatar
  • 1,948

1
2 3 4 5
8