Skip to content

Commit f4b93df

Browse files
committed
fix(mobile): add patch for react native touchable issue
Took the idea from callstack/react-native-paper#4563.
1 parent f3202fe commit f4b93df

File tree

3 files changed

+203
-3
lines changed

3 files changed

+203
-3
lines changed

mobile/package-lock.json

Lines changed: 187 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mobile/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"web": "expo start --web",
1111
"test": "jest --watchAll",
1212
"lint": "expo lint",
13-
"i18n:extract": "rm -rf tmp/i18n; npx tsc --noCheck --noEmit false --jsx preserve --outDir tmp/i18n && npx i18next-scanner"
13+
"i18n:extract": "rm -rf tmp/i18n; npx tsc --noCheck --noEmit false --jsx preserve --outDir tmp/i18n && npx i18next-scanner",
14+
"postinstall": "patch-package"
1415
},
1516
"jest": {
1617
"preset": "jest-expo"
@@ -40,6 +41,7 @@
4041
"expo-system-ui": "~4.0.6",
4142
"expo-web-browser": "~14.0.1",
4243
"i18n-js": "^4.5.1",
44+
"patch-package": "^8.0.0",
4345
"react": "18.3.1",
4446
"react-dom": "18.3.1",
4547
"react-hook-form": "^7.54.1",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/react-native-paper/src/components/BottomNavigation/BottomNavigationBar.tsx b/node_modules/react-native-paper/src/components/BottomNavigation/BottomNavigationBar.tsx
2+
index 0bfe303..8d3d47f 100644
3+
--- a/node_modules/react-native-paper/src/components/BottomNavigation/BottomNavigationBar.tsx
4+
+++ b/node_modules/react-native-paper/src/components/BottomNavigation/BottomNavigationBar.tsx
5+
@@ -360,7 +360,7 @@ const BottomNavigationBar = <Route extends BaseRoute>({
6+
navigationState,
7+
renderIcon,
8+
renderLabel,
9+
- renderTouchable = (props: TouchableProps<Route>) => <Touchable {...props} />,
10+
+ renderTouchable = ({key, ...props}: TouchableProps<Route>) => <Touchable key={key} {...props} />,
11+
getLabelText = ({ route }: { route: Route }) => route.title,
12+
getBadge = ({ route }: { route: Route }) => route.badge,
13+
getColor = ({ route }: { route: Route }) => route.color,

0 commit comments

Comments
 (0)