isLoading is true #2473
Unanswered
VikaramjitSinghGorraya
asked this question in
Q&A
Replies: 1 comment
-
Sorry, I didn’t close the issue - I moved it to discussions. It’s here: #2471 and there’s also a pointer in the issue to the discussion. Unless we have a confirmed issue with a reproduction, let’s keep things in discussions please. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please don't close the issue before the person posting the issue has replied to your comment.
In the following code when the data has been fetched and I redirect to another page and come back, isLaoding is set to true, which should not be the case as data is being taken from a cache.
import React from 'react'
import { useLocation } from 'react-router'
import {HStack, VStack, Skeleton, Box,Center, Heading, Text} from '@chakra-ui/react'
import {useQuery} from 'react-query'
import ProductCard from '../layout/ProductCard'
import {getProductsList} from '../helpers/Queries'
import Header from '../layout/Header'
const Home = () => {
}
export default Home
I have ketp the queryClient in index as follows :
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {QueryClient, QueryClientProvider} from 'react-query'
import { ReactQueryDevtools } from 'react-query/devtools'
import {BrowserRouter} from 'react-router-dom'
import { ChakraProvider, CSSReset } from "@chakra-ui/react"
const queryClient = new QueryClient()
ReactDOM.render(
<React.StrictMode>
</React.StrictMode>,
document.getElementById('root')
);
Also, I am redirecting to the page before the cache time expires
Beta Was this translation helpful? Give feedback.
All reactions