Splitting React layout components improves accessibility and cross-framework portability
A developer discovered that a React design-system layout component broke when migrated to a Next.js App Router project, because the component assumed it owned both persistent chrome and per-page content in a single composition. Next.js separates layout and page ownership across different lifecycle boundaries, making that assumption invalid. The accessibility relationships — particularly a skip link targeting a focusable page heading via a shared ID — silently broke alongside the composition model. The fix involved splitting the single layout into two explicit components: a shell owning the skip link and landmark, and a page content component owning the focusable heading. Making the accessibility contract explicit between components, rather than hiding it inside one monolithic unit, restored both portability and correct focus behaviour.


