Skip to content

Commit

Permalink
FE: Fix unnecessary full page re-rendering (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilumilak authored Oct 8, 2024
1 parent 91ed167 commit c336bbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/components/PageContainer/PageContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {
type FC,
type PropsWithChildren,
Suspense,
useEffect,
useMemo,
} from 'react';
Expand All @@ -15,6 +16,7 @@ import { useClusters } from 'lib/hooks/api/clusters';
import { ResourceType } from 'generated-sources';
import { useGetUserInfo } from 'lib/hooks/api/roles';
import { useScreenSize } from 'lib/hooks/useScreenSize';
import PageLoader from 'components/common/PageLoader/PageLoader';

const PageContainer: FC<PropsWithChildren> = ({ children }) => {
const { isLarge } = useScreenSize();
Expand Down Expand Up @@ -62,7 +64,7 @@ const PageContainer: FC<PropsWithChildren> = ({ children }) => {
aria-hidden="true"
aria-label="Overlay"
/>
{children}
<Suspense fallback={<PageLoader fullSize />}>{children}</Suspense>
</S.Container>
</>
);
Expand Down

0 comments on commit c336bbd

Please sign in to comment.