Replies: 2 comments 1 reply
-
|
I think that SETs were mainly intended for mobile devices so only iOS and Android is supported. We haven't planned to add web support yet. We also haven't made the native implementation production-ready yet, so the web implementation won't likely be added before SETs become stable om iOS and Android.
Have you tried using it? You should be able to have access to all web-specific APIs and even to use |
Beta Was this translation helpful? Give feedback.
-
|
Hmm, I couldn't get that to work initially, but then found out that if I set import { Link } from 'expo-router';
function Page() {
return (<>
<Link href="/other-page" dismissTo>This works</Link>
<Link href="/other-page">This doesn't work</Link>
</>);
}I might have a problem somewhere in my Stack routing on Web, the pages also flash slightly when navigating between them 🤔 A bit more detailed example for future Googlers:
Page first-page.tsx: import { View, Platform } from 'react-native';
import { Link } from 'expo-router';
import { Logo } from '@/components/logo';
function Page() {
return (
<View>
{/* Transition to larger logo size. */}
<LogoIcon sharedTransitionTag="logo" size={400} />
<Link href="/other-page" dismissTo={Platform.OS === 'web'}>Go to other page</Link>
</View>
);
}Page other-page.tsx: import { View, Platform } from 'react-native';
import { Link } from 'expo-router';
import { Logo } from '@/components/logo';
function Page() {
return (
<View>
{/* Transition to smaller logo size. */}
<LogoIcon sharedTransitionTag="logo" size={200} />
<Link href="/first-page" dismissTo={Platform.OS === 'web'}>Go to first page</Link>
</View>
);
}And then the logo component that supports shared element transitions: Native version logo.tsx: import { Image } from 'expo-image';
import Animated from 'react-native-reanimated';
export function Logo({ sharedTransitionTag, size = 200 }: {
readonly sharedTransitionTag: string;
readonly size: number;
}) {
return (
<Animated.Image
sharedTransitionTag={sharedTransitionTag}
source={require('@/assets/images/logo.png')}
style={{ width: size, height: size }}
/>
);
}Web version logo.web.tsx: import { Image } from 'expo-image';
import { motion } from 'motion/react';
export function Logo({ sharedTransitionTag, size = 200 }: {
readonly sharedTransitionTag: string;
readonly size: number;
}) {
return (
<motion.img
layoutId={sharedTransitionTag}
src={require('@/assets/images/logo.png')}
style={{ width: size, height: size }}
/>
);
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Really loving the new SET on iOS, but since I'm deploying to Web also via Expo and React Native Web, I'm sorta missing a bit of functionality for that.
I couldn't find any information around plans for supporting Web so wanted to check if that's a goal, or if there are at least any workarounds possible?
I know Framer Motion supports SET but I don't think that it's possible for me to use that library on React Native.
What are people currently doing? Just having no transition animations at all on Web?
Beta Was this translation helpful? Give feedback.
All reactions