Skip to content

Commit 942e6ce

Browse files
authored
chore: change default bottom tabs implementation to managed (#3408)
## Description Changes default bottom tabs implementation to managed. Bottom tabs offer 2 ways of controlling the container: - managed/natively-driven, - controlled/programmatically-driven. Most of the libraries consuming `react-native-screens` use managed tabs: [expo-router](https://github.com/expo/expo/blob/a5b3082932187d54ef3311dee21462dc07d86402/apps/expo-go/src/navigation/NativeBottomTabsNavigator.tsx#L41) and [react-navigation](https://github.com/react-navigation/react-navigation/blob/4568ec61decebf42f63e3d3b710d21b33d698846/packages/bottom-tabs/src/unstable/NativeBottomTabView.native.tsx#L150). ## Changes - change `RNS_CONTROLLED_BOTTOM_TABS_DEFAULT` to `false` ## Test code and steps to reproduce Run `TestBottomTabs`. Verify that managed implementation is used (use heavy render and switch between Tab1 and Tab2, selected tab should change immediately). ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
1 parent 623d565 commit 942e6ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/bottom-tabs/BottomTabs.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ export interface BottomTabsProps extends ViewProps {
264264
* On iOS, some features are not fully implemented for managed tabs
265265
* (e.g. overrideScrollViewContentInsetAdjustmentBehavior).
266266
*
267-
* On Android, only controlled tabs are currently supported.
267+
* On Android, only controlled tabs are currently supported and the
268+
* value of this prop is ignored.
268269
*
269270
* @default Defaults to `false`.
270271
*

src/flags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const RNS_CONTROLLED_BOTTOM_TABS_DEFAULT = true;
1+
const RNS_CONTROLLED_BOTTOM_TABS_DEFAULT = false;
22
const RNS_SYNCHRONOUS_SCREEN_STATE_UPDATES_DEFAULT = false;
33
const RNS_SYNCHRONOUS_HEADER_CONFIG_STATE_UPDATES_DEFAULT = false;
44
const RNS_SYNCHRONOUS_HEADER_SUBVIEW_STATE_UPDATES_DEFAULT = false;

0 commit comments

Comments
 (0)