"hoge-enter"や"hoge-exit" みたいなクラス名を付与 3. いい感じに位置やz-indexを調整しつつ、 CSSでアニメーション 4. アニメーションが終わったら、 古いコンテンツをアンマウント 大変! 9 old new old [hoge-exit] new [hoge-enter] old [hoge-exit] new [hoge-enter]
exit片方になる 遷移時に画面全体を動かす場合に引っかかったりするので注意 If either the mounted or unmounted side of a pair is outside the viewport, then no pair is formed. This ensures that it doesn’t fly in or out of the viewport when something is scrolled. Instead it’s treated as a regular enter/exit by itself. https://ja.react.dev/reference/react/ViewTransition#animating-a-shared-element