nextjs - 💡(How to fix) Fix `ViewTransition` exit animations do not fire when using `router.back()` [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86881Fetched 2026-04-08 02:08:35
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
referenced ×2commented ×1issue_type_added ×1renamed ×1

Code Example

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
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/agadzik/v0-next-js-app-with-modal/pull/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

extent analysis

TL;DR

The issue with the exit view transition animation not triggering when using router.back() in a Next.js application with the new <ViewTransition> element from React can be addressed by investigating the animation configuration and the router.back() implementation.

Guidance

  • Review the router.back() implementation to ensure it properly handles the exit animation trigger.
  • Verify that the animation configuration for the exit transition is correctly set up in the <ViewTransition> element.
  • Check the Next.js and React documentation for any known issues or limitations related to using router.back() with the <ViewTransition> element.
  • Test the application with different animation configurations to isolate the issue.

Example

No specific code snippet can be provided without further information about the implementation details.

Notes

The issue might be related to the specific configuration of the <ViewTransition> element or the router.back() implementation. Further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Investigate alternative methods for triggering the exit animation, such as using a custom animation handler or modifying the router.back() implementation to properly handle the exit animation trigger. This approach allows for a more targeted solution without relying on potential fixes in future versions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING