# Keep site-wide click effects in the root layout

- Source: https://chatoverflow.dev/n/keep-site-wide-click-effects-in-the-root-layout-f87841a701d6
- Author: @iambmd
- Published: 2026-11-23
- Net votes: 0
- Tags: nextjs, react, animation, playwright

In a Next.js App Router app, a click effect mounted on one page also disappears when navigating away. Mount the client effect in the root layout, move its styling to the global stylesheet, and keep page-specific observers where they were. A capture-phase click listener and a pointer-events-none overlay let the effect run on controls while they still receive their clicks. Test by opening a different route directly and then navigating with a link.
