Skip to content

Commit 652fd76

Browse files
authored
fix: add missing react-navigation props (#511)
1 parent 3572fc2 commit 652fd76

9 files changed

Lines changed: 231 additions & 25 deletions

File tree

.changeset/grumpy-laws-mix.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@bottom-tabs/react-navigation': minor
3+
'@bottom-tabs/expo-template': minor
4+
---
5+
6+
Add missing props from react-navigation to NativeBottomTabNavigator

apps/example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ PODS:
17481748
- React-RCTFBReactNativeSpec
17491749
- ReactCommon/turbomodule/core
17501750
- SocketRocket
1751-
- react-native-bottom-tabs (1.0.5):
1751+
- react-native-bottom-tabs (1.1.0):
17521752
- boost
17531753
- DoubleConversion
17541754
- fast_float
@@ -1766,7 +1766,7 @@ PODS:
17661766
- React-graphics
17671767
- React-ImageManager
17681768
- React-jsi
1769-
- react-native-bottom-tabs/common (= 1.0.5)
1769+
- react-native-bottom-tabs/common (= 1.1.0)
17701770
- React-NativeModulesApple
17711771
- React-RCTFabric
17721772
- React-renderercss
@@ -1778,7 +1778,7 @@ PODS:
17781778
- SocketRocket
17791779
- SwiftUIIntrospect (~> 1.0)
17801780
- Yoga
1781-
- react-native-bottom-tabs/common (1.0.5):
1781+
- react-native-bottom-tabs/common (1.1.0):
17821782
- boost
17831783
- DoubleConversion
17841784
- fast_float
@@ -2842,7 +2842,7 @@ SPEC CHECKSUMS:
28422842
React-logger: a3cb5b29c32b8e447b5a96919340e89334062b48
28432843
React-Mapbuffer: 9d2434a42701d6144ca18f0ca1c4507808ca7696
28442844
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
2845-
react-native-bottom-tabs: 8e918142554e3878f043b23bdf93049b34a78ca6
2845+
react-native-bottom-tabs: e33312fc663d163f0be73d3474dfb448ba38dad8
28462846
react-native-safe-area-context: c6e2edd1c1da07bdce287fa9d9e60c5f7b514616
28472847
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
28482848
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d

apps/example/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
},
1313
"dependencies": {
1414
"@bottom-tabs/react-navigation": "*",
15-
"@react-navigation/bottom-tabs": "^7.4.7",
15+
"@react-navigation/bottom-tabs": "^7.15.9",
1616
"@react-navigation/devtools": "^7.0.44",
17-
"@react-navigation/native": "^7.1.17",
18-
"@react-navigation/native-stack": "^7.3.26",
19-
"@react-navigation/stack": "^7.4.8",
17+
"@react-navigation/native": "^7.2.2",
18+
"@react-navigation/native-stack": "^7.14.11",
19+
"@react-navigation/stack": "^7.8.10",
2020
"color": "^5.0.0",
2121
"react": "^19.1.0",
2222
"react-native": "^0.81.4",

apps/example/src/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import NativeBottomTabsRemoteIcons from './Examples/NativeBottomTabsRemoteIcons'
3535
import NativeBottomTabsUnmounting from './Examples/NativeBottomTabsUnmounting';
3636
import NativeBottomTabsCustomTabBar from './Examples/NativeBottomTabsCustomTabBar';
3737
import NativeBottomTabsFreezeOnBlur from './Examples/NativeBottomTabsFreezeOnBlur';
38+
import NativeBottomTabsScreenLayout from './Examples/NativeBottomTabsScreenLayout';
3839
import BottomAccessoryView from './Examples/BottomAccessoryView';
3940
import { useLogger } from '@react-navigation/devtools';
4041

@@ -151,6 +152,10 @@ const examples = [
151152
component: NativeBottomTabsCustomTabBar,
152153
name: 'Native Bottom Tabs with Custom Tab Bar',
153154
},
155+
{
156+
component: NativeBottomTabsScreenLayout,
157+
name: 'Native Bottom Tabs with screenLayout',
158+
},
154159
{ component: NativeBottomTabs, name: 'Native Bottom Tabs' },
155160
{ component: JSBottomTabs, name: 'JS Bottom Tabs' },
156161
{
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import * as React from 'react';
2+
import { StyleSheet, Text, View } from 'react-native';
3+
import { Article } from '../Screens/Article';
4+
import { Albums } from '../Screens/Albums';
5+
import { Contacts } from '../Screens/Contacts';
6+
import { Chat } from '../Screens/Chat';
7+
import { createNativeBottomTabNavigator } from '@bottom-tabs/react-navigation';
8+
9+
const Tab = createNativeBottomTabNavigator();
10+
11+
function ScreenLayout({
12+
children,
13+
route,
14+
}: {
15+
children: React.ReactNode;
16+
route: { name: string };
17+
}) {
18+
return (
19+
<View style={styles.container}>
20+
<View style={styles.banner}>
21+
<Text style={styles.bannerTitle}>screenLayout active</Text>
22+
<Text style={styles.bannerSubtitle}>{route.name}</Text>
23+
</View>
24+
<View style={styles.content}>{children}</View>
25+
</View>
26+
);
27+
}
28+
29+
export default function NativeBottomTabsScreenLayout() {
30+
return (
31+
<Tab.Navigator screenLayout={ScreenLayout}>
32+
<Tab.Screen
33+
name="Article"
34+
component={Article}
35+
options={{
36+
tabBarIcon: () => require('../../assets/icons/article_dark.png'),
37+
}}
38+
/>
39+
<Tab.Screen
40+
name="Albums"
41+
component={Albums}
42+
options={{
43+
tabBarIcon: () => require('../../assets/icons/grid_dark.png'),
44+
}}
45+
/>
46+
<Tab.Screen
47+
name="Contacts"
48+
component={Contacts}
49+
options={{
50+
tabBarIcon: () => require('../../assets/icons/person_dark.png'),
51+
}}
52+
/>
53+
<Tab.Screen
54+
name="Chat"
55+
component={Chat}
56+
options={{
57+
tabBarIcon: () => require('../../assets/icons/chat_dark.png'),
58+
}}
59+
/>
60+
</Tab.Navigator>
61+
);
62+
}
63+
64+
const styles = StyleSheet.create({
65+
container: {
66+
flex: 1,
67+
backgroundColor: '#F3F0E8',
68+
},
69+
banner: {
70+
paddingHorizontal: 16,
71+
paddingVertical: 12,
72+
backgroundColor: '#1E2D2F',
73+
},
74+
bannerTitle: {
75+
color: '#F7DBA7',
76+
fontSize: 12,
77+
fontWeight: '700',
78+
textTransform: 'uppercase',
79+
letterSpacing: 1,
80+
},
81+
bannerSubtitle: {
82+
marginTop: 4,
83+
color: '#FFFFFF',
84+
fontSize: 16,
85+
fontWeight: '600',
86+
},
87+
content: {
88+
flex: 1,
89+
},
90+
});

packages/expo-template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"dependencies": {
2121
"@bottom-tabs/react-navigation": "1.1.0",
2222
"@expo/vector-icons": "^14.0.2",
23-
"@react-navigation/native": "^7.1.17",
23+
"@react-navigation/native": "^7.2.2",
2424
"expo": "^54.0.1",
2525
"expo-blur": "^15.0.6",
2626
"expo-build-properties": "^1.0.7",

packages/react-navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"access": "public"
5757
},
5858
"devDependencies": {
59-
"@react-navigation/native": "^7.1.17",
59+
"@react-navigation/native": "^7.2.2",
6060
"@types/color": "^4.2.0",
6161
"jest": "^29.7.0",
6262
"react": "^19.1.0",

packages/react-navigation/src/navigators/createNativeBottomTabNavigator.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ function NativeBottomTabNavigator({
3737
id,
3838
initialRouteName,
3939
backBehavior,
40+
UNSTABLE_routeNamesChangeBehavior,
4041
children,
4142
layout,
4243
screenListeners,
4344
screenOptions,
45+
screenLayout,
46+
UNSTABLE_router,
4447
tabBarActiveTintColor: customActiveTintColor,
4548
tabBarInactiveTintColor: customInactiveTintColor,
4649
layoutDirection = 'locale',
@@ -68,10 +71,13 @@ function NativeBottomTabNavigator({
6871
id,
6972
initialRouteName,
7073
backBehavior,
74+
UNSTABLE_routeNamesChangeBehavior,
7175
children,
7276
layout,
7377
screenListeners,
7478
screenOptions,
79+
screenLayout,
80+
UNSTABLE_router,
7581
});
7682

7783
return (

0 commit comments

Comments
 (0)