fix: refetching queries (#65)

* fix: fix refetcing data on focused

* fix: add key to SiteCard items
This commit is contained in:
Camila Sosa Morales 2023-01-09 13:03:39 -05:00 committed by GitHub
parent 04991eaeff
commit 23dc080c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -7,7 +7,9 @@ import { Provider as ReduxProvider } from 'react-redux';
import { store } from './store';
import { QueryClient, QueryClientProvider } from 'react-query';
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: { queries: { refetchOnWindowFocus: false } },
});
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement

View File

@ -14,7 +14,7 @@ export const ListSites = () => {
<Flex gap={10} mt="40px" flexWrap="wrap" justifyContent="center">
{new Array(data).fill(0).map((_, index) => {
const id = data - index - 1;
return <SiteCard tokenId={id} />;
return <SiteCard key={id} tokenId={id} />;
})}
</Flex>
);