Skip to content

Commit

Permalink
Merge pull request #33841 from callstack-internal/fix/top-tabs-animat…
Browse files Browse the repository at this point in the history
…ions-performance

Fix OnyxTab Navigator performance issues on web
  • Loading branch information
stitesExpensify authored Jan 10, 2024
2 parents 582b853 + 7bb0b0c commit f15ed75
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libs/Navigation/OnyxTabNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {OnyxEntry} from 'react-native-onyx/lib/types';
import Tab from '@userActions/Tab';
import ONYXKEYS from '@src/ONYXKEYS';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import {defaultScreenOptions} from './OnyxTabNavigatorConfig';

type OnyxTabNavigatorOnyxProps = {
selectedTab: OnyxEntry<string>;
Expand Down Expand Up @@ -51,6 +52,7 @@ function OnyxTabNavigator({id, selectedTab = '', children, onTabSelected = () =>
},
...(screenListeners ?? {}),
}}
screenOptions={defaultScreenOptions}
>
{children}
</TopTab.Navigator>
Expand Down
8 changes: 8 additions & 0 deletions src/libs/Navigation/OnyxTabNavigatorConfig/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const defaultScreenOptions = {
animationEnabled: true,
} as const;

export {
// eslint-disable-next-line import/prefer-default-export
defaultScreenOptions,
};
8 changes: 8 additions & 0 deletions src/libs/Navigation/OnyxTabNavigatorConfig/index.website.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const defaultScreenOptions = {
animationEnabled: false,
} as const;

export {
// eslint-disable-next-line import/prefer-default-export
defaultScreenOptions,
};

0 comments on commit f15ed75

Please sign in to comment.