Skip to content

ViewTransition exit animations do not fire when using router.back() #86881

@agadzik

Description

@agadzik

Link to the code that reproduces this issue

agadzik/v0-next-js-app-with-modal#1

To Reproduce

  1. Start the application in development mode (pnpm dev)
  2. Click on the "Open About (Modal)" button, notice the enter view transition animation trigger
  3. Press ESC or click outside of the modal to close it.
  4. Notice that the exit view transition animation does not trigger

Current vs. Expected behavior

When using the new <ViewTransition> element from react and the latest version of next, exit animations do not trigger when using router.back()

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 20.18.3
  npm: 10.8.2
  Yarn: N/A
  pnpm: 10.18.2
Relevant Packages:
  next: 16.0.7 // Latest available version is detected (16.0.7).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.0.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions