We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee8c2c commit fdf8ae3Copy full SHA for fdf8ae3
fixtures/view-transition/src/components/Page.js
@@ -1,4 +1,5 @@
1
import React, {
2
+ unstable_addTransitionType as addTransitionType,
3
unstable_ViewTransition as ViewTransition,
4
unstable_Activity as Activity,
5
useLayoutEffect,
@@ -113,7 +114,12 @@ export default function Page({url, navigate}) {
113
114
<div className="swipe-recognizer">
115
<SwipeRecognizer
116
action={swipeAction}
- gesture={optimisticNavigate}
117
+ gesture={direction => {
118
+ addTransitionType(
119
+ direction === 'left' ? 'navigation-forward' : 'navigation-back'
120
+ );
121
+ optimisticNavigate(direction);
122
+ }}
123
direction={show ? 'left' : 'right'}>
124
<button
125
className="button"
0 commit comments