Skip to content

Commit 73c8a6a

Browse files
taehallmweb-flow
andcommitted
fix: return null instead of loading div for better UX
Address PR feedback - returning null avoids layout shift and provides cleaner user experience during brief component lazy-loading period. Also fix TypeScript error by properly typing the _payload check. Co-authored-by: jimmylee <[email protected]>
1 parent 549cab6 commit 73c8a6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/DropdownMenuTrigger.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function DropdownMenuTrigger({ children, items, hotkey }: DropdownMenuTriggerPro
9191
}, [open]);
9292

9393
// Handle lazy-loaded components - this is the key fix
94-
if (!children || children.type === undefined || children._payload) {
95-
return <div>Loading...</div>;
94+
if (!children || children.type === undefined || (children as any)._payload) {
95+
return null;
9696
}
9797

9898
const element = open

0 commit comments

Comments
 (0)