You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to get the data of the query only once, not from cache (forceRefetch), without any updates. Haven't found any way to easily (with UseQueryOptions) get the data with useQuery without subscribing to that query.
There are few other options:
There's the initiate function
const{data}=useQuery(undefiend,{refetchOnMountOrArgChange:true})useEffect(()=>{if(!isUninitialized&&data){//here do with first queried data whatever you wish}},[isUninitialized,data]);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to get the data of the query only once, not from cache (forceRefetch), without any updates. Haven't found any way to easily (with UseQueryOptions) get the data with useQuery without subscribing to that query.
There are few other options:
initiate
functionWhat would you suggest?
Beta Was this translation helpful? Give feedback.
All reactions