// app/_layout.tsx
import { Transition } from 'react-native-screen-transitions';
import { interpolate } from 'react-native-reanimated';
import { Stack } from 'expo-router';
export default function RootLayout() {
const slideInterpolator = ({ progress }) => {
"worklet";
return {
content: {
style: {
opacity: interpolate(progress, [0, 1], [0, 1]),
transform: [
{
translateX: interpolate(progress, [0, 1], [50, 0]),
},
],
},
},
backdrop: {
style: {
opacity: interpolate(progress, [0, 1], [0, 0.5]),
},
},
};
};
return (
<Transition.Stack
screenStyleInterpolator={slideInterpolator}
gestureEnabled
gestureDirection="horizontal"
>
<Stack.Screen name="index" options={{ title: 'Home' }} />
<Stack.Screen name="details/[id]" options={{ title: 'Details' }} />
<Stack.Screen name="modal/settings" options={{ presentation: 'modal' }} />
</Transition.Stack>
);
}