TanStack

T

TanStack

TanStack is a community of passionate software engineers striving for high-quality, open-source software for web devs

Join

react-query-questions

solid-query-questions

table-questions

virtual-questions

router-questions

react-charts-questions

ranger-questions

vue-query-questions

svelte-query-questions

bling-questions

form-questions

angular-query-questions

start-questions

db-questions

start-showcase

router-showcase

📣-announcements

metropolitan-bronze
metropolitan-bronze6/10/2024

container shrinking when loading

I load a different api when some state changes.when i change state and api starts loading,my container becomes empty and shrinks in a way it has no data then immediately gets new data. It is a disgusting design for the user's eyes so how can i prevent it?(I want to show something like a spinner but that spinner isnt guaranteed to be the same height as the previous data of the container)...
national-gold
national-gold6/10/2024

Calling server action using useQuery?

```tsx 'use client'; import { useQuery } from '@tanstack/react-query'; export const runtime = 'edge';...
fair-rose
fair-rose6/10/2024

Select portion of useQuery only runs on first page load

I am building a table of Quotes where I get the quotes using useQuery andI have a filter up top. So what I have done is use the select property to build two state arrays, all and filtered. That looks like this: ```js const { data: priceLists, isLoading: gettingPriceLists,...
magic-amber
magic-amber6/10/2024

Devtools CapacitorJS

Hey guys, I'm I'm implementing react-query in my CapacitorJS app, and I'm developping on an iPhone emulator. Wanted to know if the default devtools should works or if I need to use the react-native devtools ? Thanks!...
foreign-sapphire
foreign-sapphire6/10/2024

how to update the querry data if any mutation occurred

I have fetch all post from backend with react query. Mapping over the data array which react query provide i have render all post. Now lets say I have LIKE button on each post , if a user like any post how should I update the data state? I don’t want to refetch again. What could be the good of doing this. Does invalidating the query make fetch again?...
sensitive-blue
sensitive-blue6/9/2024

Can I get notified that all useQuery hooks for a query key have unmounted?

Or can I set gcTime to 0 and get notified of that? I'm using fetch functions that start subscribing to data on a WebSocket and I'd like to know when to unsubscribe....
robust-apricot
robust-apricot6/8/2024

queryClient.prefetchQuery not prefeching on the server (Next App Router)

I beleive i did everything correctly form tanstack documentation
No description
wise-white
wise-white6/8/2024

Query not working correctly until changing query key to a new, clean one

Hi everyone. My query doesn't fetch data server side after I changed the query key forward and then back. The part that confuses me is that I don't use any external storage plugins, but the issue resolves if I change the key to a new, clean value. Restarting the app doesn't help. How does React Query preserve cache between app starts?
ratty-blush
ratty-blush6/8/2024

useMutation not functioning

I have React and React-dom updated to version 18 and I am getting this error from Tanstack's useMutation function Uncaught TypeError: React10.useSyncExternalStore is not a function Has anyone ran into this issue before or have any insight on what I should be doing or looking for?
foreign-sapphire
foreign-sapphire6/8/2024

how to access react query fetched data in all component

I have fetched data in my home component but I want to access the same data in my nested component, is it possible to access the data globally without passing as props.
fair-rose
fair-rose6/8/2024

The background of the birth of the Tanstack Query and the current concerns or future.

Hello. My name is Aaron Kim. While using Tanstack Query, I felt that it was a very convenient and useful tool. I gave you a mention because I wanted to ask you a simple question about preparing for the technical seminar on Tanstack Query at my company. Of course, I can collect and organize information through Googling, but I actually wanted to hear Co-Maintainer's opinions in person. I know you are busy, but I would appreciate it if you could respond. @TkDodo 🔮 1. I'm curious about the background where Tanstack Query technology was born. ...
passive-yellow
passive-yellow6/7/2024

How to setup automatic invalidation after mutation

I want to setup a remix like automatic invalidation. I saw this post from TkDodo: https://tkdodo.eu/blog/automatic-query-invalidation-after-mutations#the-global-cache-callbacks But I am having trouble understanding how is solution is possible. ```tsx...
causal-orange
causal-orange6/6/2024

useQuery options changed per hook invocation

Hi there, I'm adoptiong react-query throughout my app and have a breif question regarding the architecture: Say I have a custom hook that wraps useQuery, and accepts one argument to override a useQuery option: ``` function useCustomQuery(refetchInterval: number) {...
like-gold
like-gold6/6/2024

How to Combine and Handle Multiple Mutations with Shared Success and Error Handling in React Query?

I have two mutations (2 fetch put request) in the same react component, i have modals i show for both on success and onerror, how can i combine those two mutations since i dont want to show one modal for each mutation.
extended-salmon
extended-salmon6/6/2024

setQueryData with marked data to no refetch data in specific time

- I have the same endpoint using by useMutation and useQuery - first app start I call useMutation and there is any data I would navigate to the screen then in the screen also have useQuery using the same endpoint as useMutation - I want to use setQueryData in useMutation onSuccess with marked query to not refetch when I navigate to the screen that using useQuery - is is possble to call setQueryData and marked the query as refetched ? - WHY I using like this ? -> I migrate from redux to useQuery but some how I want to save requesting to my...
protestant-coral
protestant-coral6/5/2024

createAsyncStoragePersister is not a function (it is undefined)

Hey guys, I am trying to implement the persistent storage on my react-native app, but I get the error: TypeError: (0 , _queryAsyncStoragePersister.createAsyncStoragePersister) is not a function. This is my persister: ...
correct-apricot
correct-apricot6/3/2024

How to implement Algolia with react-query

Is there a way I can separate my query state and render my SearchResults component in another component that isn't my Search component? ``` import * as React from 'react' import SearchResults from './SearchResults'...
xenial-black
xenial-black6/2/2024

Query DevTools - Data sort order in Data Explorer

@TkDodo 🔮 How is the data sorted in the data explorer? Is it possible to sort it alphabetically same as in Query Explorer? Thank you....
xenial-black
xenial-black6/2/2024

Question about stable data

```jsx export const useQueryTesting = (key: number) => { return useQuery({ queryKey: ['testing', key], placeholderData: (prev) => prev,...