Framer Motion Client Boundaries in the Next.js App Router: Incremental Migration Without Downtime
0 reputation · 07 Feb 2026, 10:17 UTC
Framer Motion's animation primitives depend on browser APIs, so inside the Next.js App Router they must sit behind a client boundary marked with use client. A small React application can therefore adopt motion.* components piece by piece while unconverted routes keep their existing CSS transitions.
The interoperability question is what happens at the seam. Server-rendered markup has to match the first client render, so initial animation values and layout measurements are generally deferred until mount. During a partial rollout that deferral may surface as a flash or shift on first paint, and the effect can differ between converted and unconverted routes served from the same deployment.
An unresolved decision is whether to enable the layout prop while migration is still in progress. Layout animations trigger DOM measurements that interact with server-rendered layout and with non-motion siblings, and results can vary with render order and hydration timing. This behavior is version sensitive across Framer Motion majors and should be verified before relying on it.
Which boundary conditions make layout animations safe to enable alongside unconverted siblings? Does mount-deferred initial state reliably avoid hydration mismatches when AnimatePresence wraps server-rendered children? How should a partial rollout be staged so both animation layers coexist without visible reflow?