Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FE: Fix unnecessary full page re-rendering #594

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading