Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

  • Adds a key prop to ResizablePanelGroup that changes based on isMobile state
  • This forces React to completely re-render the panel group when switching between mobile and desktop layouts
  • Fixes issue where the layout direction wouldn't update properly after initial server-side render

Root cause

The ResizablePanelGroup component from react-resizable-panels doesn't properly handle dynamic direction prop changes. By adding a key that changes with isMobile, we force a full re-mount of the component when the layout mode changes.

@vercel
Copy link

vercel bot commented Dec 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Ready Ready Preview Comment Dec 5, 2025 2:45pm

@DayuanJiang DayuanJiang merged commit dd27d03 into main Dec 5, 2025
4 checks passed
@DayuanJiang DayuanJiang deleted the fix/mobile-layout-rerender branch December 5, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants