Skip to content

Commit eece0de

Browse files
chore: Disable Stack animation on macos (#8424)
## Summary `Stack.Navigator` config option `animation` does not work on macos by default. This is quite a quick fix, cause I'm not sure why the animation does not work on `Stack` - I suppose it is not integrated for MacOS. For now, to test Reanimated I'd suggest we merge this, and in the future eventually adjust ## Test plan
1 parent a4cef53 commit eece0de

File tree

1 file changed

+9
-1
lines changed
  • apps/common-app/src/apps/reanimated

1 file changed

+9
-1
lines changed

apps/common-app/src/apps/reanimated/App.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,16 @@ const screenOptions = {
131131
headerRight: IS_MACOS ? undefined : () => <DrawerButton />,
132132
};
133133

134+
type AnimationType = 'none' | 'default' | 'fade';
135+
134136
function Navigator() {
135137
const shouldReduceMotion = useReducedMotion();
138+
let animation: AnimationType = 'default';
139+
if (IS_MACOS) {
140+
animation = 'none';
141+
} else if (shouldReduceMotion) {
142+
animation = 'fade';
143+
}
136144

137145
return (
138146
<Stack.Navigator screenOptions={screenOptions}>
@@ -150,7 +158,7 @@ function Navigator() {
150158
name={name}
151159
component={EXAMPLES[name].screen}
152160
options={{
153-
animation: shouldReduceMotion ? 'fade' : 'default',
161+
animation: animation,
154162
headerTitle: EXAMPLES[name].title,
155163
title: EXAMPLES[name].title,
156164
}}

0 commit comments

Comments
 (0)