Firstly, thanks for your work on this project! š
Today I used patch-package to patch react-native-paper@5.12.5 for the project I'm working on.
Recently upgraded an expo project to Expo SDK 52 which includes react-native 0.76, the following warning/error is being thrown when rendering a BottomNavigationBar:
ERROR Warning: A props object containing a "key" prop is being spread into JSX:
let props = {key: someKey, route: ..., borderless: ..., centered: ..., rippleColor: ..., onPress: ..., onLongPress: ..., testID: ..., accessibilityLabel: ..., accessibilityRole: ..., accessibilityState: ..., style: ..., children: ...};
<Touchable {...props} />
React keys must be passed directly to JSX without using spread:
let props = {route: ..., borderless: ..., centered: ..., rippleColor: ..., onPress: ..., onLongPress: ..., testID: ..., accessibilityLabel: ..., accessibilityRole: ..., accessibilityState: ..., style: ..., children: ...};
<Touchable key={someKey} {...props} />
in BottomNavigation.Bar (created by BottomNavigation)
in RCTView (created by View)
in View (created by BottomNavigation)
in BottomNavigation (created by MaterialBottomTabView)
in MaterialBottomTabView (created by MaterialBottomTabNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by MaterialBottomTabNavigator)
in MaterialBottomTabNavigator (created by MemoHomeScreen)
The stack trace is much longer but I stopped at MemoHomeScreen as that is the first of my own files.
I delved into the source code and found the following which the diff that solved my problem:
P.S. This diff only changes the source file, the .js file in node_modules/react-native-paper/lib/module/components/BottomNavigation/BottomNavigationBar.js will also need changing if patching yourself, something like:
Hi! š
Firstly, thanks for your work on this project! š
Today I used patch-package to patch
react-native-paper@5.12.5
for the project I'm working on.Recently upgraded an expo project to Expo SDK 52 which includes react-native 0.76, the following warning/error is being thrown when rendering a
BottomNavigationBar
:The stack trace is much longer but I stopped at MemoHomeScreen as that is the first of my own files. I delved into the source code and found the following which the diff that solved my problem:
This issue body was partially generated by patch-package.
P.S. This diff only changes the source file, the .js file in
node_modules/react-native-paper/lib/module/components/BottomNavigation/BottomNavigationBar.js
will also need changing if patching yourself, something like: