All Questions
Tagged with react-query javascript
425
questions
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 ...
-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 ...
0
votes
0
answers
63
views
React query not updating data even after refetch shows new data from api
I am using react query to fetch a list of items. After creating a new item, I am calling refetch on my query to get the updated list. I see a new api call is made, and the new item I just created is ...
1
vote
0
answers
66
views
Unhandled Runtime Error: data is undefined in useSuspenseQuery with Next.js and Tanstack Query
I am working on a Next.js application where I have implemented a commenting system. Users can post a review for a particular AI tool, reply to a review, and reply to a reply as well.
I have a ...
0
votes
0
answers
32
views
How to make `refetchQueries` trigger regardless of whether data is cached or not?
import { useMutation, useQueryClient } from "@tanstack/react-query";
import api from "./Api";
export const useUploadProduct = () => {
const qc = useQueryClient();
return ...
0
votes
0
answers
34
views
React Query: How can I disable a query based on whether there is data in the database?
I'm using a simple custom hook to fill in a form with data that a user may have previously entered in previous sessions.
export function useGetData() {
return useQuery({
queryFn: ...
1
vote
2
answers
219
views
How do I fix this error: Query data cannot be undefined. Please make sure to return a value other than undefined from your query function
I have the following code.
import Post from "../post/Post";
import "./posts.scss";
import {useQuery} from "@tanstack/react-query";
import {makeRequest} from "../../...
-1
votes
1
answer
119
views
React Query useQuery can't trigger repeat call on click
I have a table of info where each row has a button to trigger a useQuery that will eventually open a new tab where more info about that row can be seen.
I can trigger the call to work as expected the ...
0
votes
1
answer
35
views
How can all APIs be refreshed in a React component when any action is triggered?
import AppTextInput from '@/components/form-fields/AppTextInput';
import Iconify from '@/components/iconify/Iconify';
import AppButton from '@/components/templates/AppButton';
import AppDataGrid from '...
0
votes
2
answers
71
views
Why my React Query does not instant update UI after delete? USING SUPABASE
Whenever delete is performed, supabase database is updated instantly but not in UI, If manually refreshed then updated list is shown to the UI... what to do please help!!
I have added EntryTable, ...
1
vote
0
answers
59
views
TypeError in Tanstack Query React
I am new to react tanstack query and I am building a todo list app to reinforce the concepts that I am learning. The todos are coming from DummyJson API -https://dummyjson.com/docs/todos. The response ...
0
votes
0
answers
103
views
Getting the error " Should have a queue" when using React-Query mutation
I'm trying to figured out how to implement react-query in my react-native app. I'm executing a simple firebase login function from react-query mutation. Then in my signIn component I will call the ...
0
votes
1
answer
52
views
How to execute Pagination in firebase or react query
i'm trying to paginate my products from my firebase firestore but the products are not loding its returning null or undefined
here is my state context i just dont seem to get it right
const [items, ...
0
votes
0
answers
128
views
Why do I keep getting an error saying query client isn't set?
I'm trying to use React Query but it's been excruciatingly difficult to setup. Been stuck on this for like 3hrs already.
I've tried everything under the sun to resolve the Uncaught Error: No ...
0
votes
1
answer
229
views
Make react-query useMutation to handle an Error
There's a strange issue which I don't undrestand - react-query's useMutation doesn't handle an error while @tanstack/react-query's does.
A Sandbox
import { useState } from "react";
import {
...