Skip to content

Commit 86ae0d6

Browse files
committed
fix: don't use row-reverse for tab position
1 parent e1a6387 commit 86ae0d6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

packages/bottom-tabs/src/views/BottomTabView.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
type ParamListBase,
1010
StackActions,
1111
type TabNavigationState,
12-
useLocale,
1312
} from '@react-navigation/native';
1413
import * as React from 'react';
1514
import { Animated, Platform, StyleSheet } from 'react-native';
@@ -87,8 +86,6 @@ export function BottomTabView(props: Props) {
8786

8887
const focusedRouteKey = state.routes[state.index].key;
8988

90-
const { direction } = useLocale();
91-
9289
/**
9390
* List of loaded tabs, tabs will be loaded when navigated to.
9491
*/
@@ -233,24 +230,29 @@ export function BottomTabView(props: Props) {
233230

234231
const { tabBarPosition = 'bottom' } = descriptors[focusedRouteKey].options;
235232

233+
const tabBarElement = (
234+
<BottomTabBarHeightCallbackContext.Provider
235+
key="tabbar"
236+
value={setTabBarHeight}
237+
>
238+
{renderTabBar()}
239+
</BottomTabBarHeightCallbackContext.Provider>
240+
);
241+
236242
return (
237243
<SafeAreaProviderCompat
238244
style={{
239245
flexDirection:
240246
tabBarPosition === 'left' || tabBarPosition === 'right'
241-
? (tabBarPosition === 'left' && direction === 'ltr') ||
242-
(tabBarPosition === 'right' && direction === 'rtl')
243-
? 'row-reverse'
244-
: 'row'
247+
? 'row'
245248
: 'column',
246249
}}
247250
>
248-
{tabBarPosition === 'top' ? (
249-
<BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>
250-
{renderTabBar()}
251-
</BottomTabBarHeightCallbackContext.Provider>
252-
) : null}
251+
{tabBarPosition === 'top' || tabBarPosition === 'left'
252+
? tabBarElement
253+
: null}
253254
<MaybeScreenContainer
255+
key="screens"
254256
enabled={detachInactiveScreens}
255257
hasTwoStates={hasTwoStates}
256258
style={styles.screens}
@@ -348,11 +350,9 @@ export function BottomTabView(props: Props) {
348350
);
349351
})}
350352
</MaybeScreenContainer>
351-
{tabBarPosition !== 'top' ? (
352-
<BottomTabBarHeightCallbackContext.Provider value={setTabBarHeight}>
353-
{renderTabBar()}
354-
</BottomTabBarHeightCallbackContext.Provider>
355-
) : null}
353+
{tabBarPosition === 'bottom' || tabBarPosition === 'right'
354+
? tabBarElement
355+
: null}
356356
</SafeAreaProviderCompat>
357357
);
358358
}

0 commit comments

Comments
 (0)