Bacancy Technology
Bacancy Technology represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.
12+
Countries where we have happy customers
1050+
Agile enabled employees
06
World wide offices
12+
Years of Experience
05
Agile Coaches
14
Certified Scrum Masters
1000+
Clients projects
1458
Happy customers
Artificial Intelligence
Machine Learning
Salesforce
Microsoft
SAP
September 4, 2024
To fix this issue and ensure that useQuery refetches the data every 3 seconds, we can disable caching for that specific Axios request. Here’s how we can do it:
const { data, isFetching } = useQuery( ['test'], () => axios.get('https://jsonplaceholder.typicode.com/todos/1', { cache: false }), { refetchInterval: 3000 } );
Depending on the caching library we are using with Axios, we can usually disable caching for individual requests by adding a configuration option.