From d122cada9698a5ee6f3c4dacd2c04bfa1aeb9344 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Fri, 10 Jan 2025 12:24:23 -0500 Subject: [PATCH] Update fixture --- .../view-transition/src/components/Page.js | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/fixtures/view-transition/src/components/Page.js b/fixtures/view-transition/src/components/Page.js index 8a3638b01f4b3..098fbbe3baf7b 100644 --- a/fixtures/view-transition/src/components/Page.js +++ b/fixtures/view-transition/src/components/Page.js @@ -37,21 +37,17 @@ function Component() { } export default function Page({url, navigate}) { - const ref = useRef(); const show = url === '/?b'; - useLayoutEffect(() => { - const viewTransition = ref.current; - requestAnimationFrame(() => { - const keyframes = [ - {rotate: '0deg', transformOrigin: '30px 8px'}, - {rotate: '360deg', transformOrigin: '30px 8px'}, - ]; - viewTransition.old.animate(keyframes, 300); - viewTransition.new.animate(keyframes, 300); - }); - }, [show]); + function onTransition(viewTransition) { + const keyframes = [ + {rotate: '0deg', transformOrigin: '30px 8px'}, + {rotate: '360deg', transformOrigin: '30px 8px'}, + ]; + viewTransition.old.animate(keyframes, 250); + viewTransition.new.animate(keyframes, 250); + } const exclamation = ( - + ! ); @@ -76,7 +72,7 @@ export default function Page({url, navigate}) { {a} )} - + {show ?
hello{exclamation}
:
Loading
}

scroll me