Skip to content

Commit

Permalink
[@mantine/core] AppShell: Fix error when Suspense is rendered inside …
Browse files Browse the repository at this point in the history
…AppShell (#6927)
  • Loading branch information
RabeeAbuBaker authored Oct 2, 2024
1 parent 397e782 commit 9e8d47a
Showing 1 changed file with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ export function useResizing({ transitionDuration, disabled }: UseResizingInput)
useWindowEvent('resize', () => {
setResizing(true);
clearTimeout(resizingTimeout.current);
resizingTimeout.current = window.setTimeout(() => setResizing(false), 200);
resizingTimeout.current = window.setTimeout(
() =>
startTransition(() => {
setResizing(false);
}),
200
);
});

useIsomorphicEffect(() => {
startTransition(() => {
setResizing(true);
clearTimeout(disabledTimeout.current);
disabledTimeout.current = window.setTimeout(
() => setResizing(false),
transitionDuration || 0
);
});
setResizing(true);
clearTimeout(disabledTimeout.current);
disabledTimeout.current = window.setTimeout(
() =>
startTransition(() => {
setResizing(false);
}),
transitionDuration || 0
);
}, [disabled, transitionDuration]);

return resizing;
Expand Down

0 comments on commit 9e8d47a

Please sign in to comment.