Skip to content

Commit 8d8d3aa

Browse files
committed
fix: AppLayoutPartLoader mounting issue
1 parent 34072a6 commit 8d8d3aa

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/app-layout/visual-refresh-toolbar/internal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ export function createAppLayoutPart({ Component }: { Component: React.JSXElement
4141
const ref = useRef<HTMLDivElement>(null);
4242

4343
useEffect(() => {
44-
setTimeout(() => {
44+
const timeoutId = setTimeout(() => {
4545
setMount(true);
46-
}, 500);
46+
}, 1000);
47+
48+
return () => clearTimeout(timeoutId);
4749
}, []);
4850

4951
if (!enableDelayedComponents || (mount && enableDelayedComponents)) {

src/breadcrumb-group/internal.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export const InternalBreadcrumbGroup = createWidgetizedBreadcrumbGroup(
99
);
1010

1111
const enableDelayedComponents = false;
12-
const enableSyncComponents = true;
1312

1413
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1514
export function createAppLayoutPart({ Component }: { Component: React.JSXElementConstructor<any> }) {
@@ -19,12 +18,14 @@ export function createAppLayoutPart({ Component }: { Component: React.JSXElement
1918
const ref = useRef<HTMLDivElement>(null);
2019

2120
useEffect(() => {
22-
setTimeout(() => {
21+
const timeoutId = setTimeout(() => {
2322
setMount(true);
2423
}, 1000);
24+
25+
return () => clearTimeout(timeoutId);
2526
}, []);
2627

27-
if (enableSyncComponents || (mount && enableDelayedComponents)) {
28+
if (!enableDelayedComponents || (mount && enableDelayedComponents)) {
2829
return <Component {...props} />;
2930
}
3031

0 commit comments

Comments
 (0)