@momo-kits/foundation 0.92.1-rc.4 → 0.92.1-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,7 +125,7 @@ export const getTabBarHeight = ({
125
125
  export default function BottomTabBar({
126
126
  state,
127
127
  navigation,
128
- descriptors,
128
+ descriptors = {},
129
129
  activeBackgroundColor,
130
130
  activeTintColor,
131
131
  adaptive,
@@ -165,7 +165,7 @@ export default function BottomTabBar({
165
165
  tabStyle,
166
166
  });
167
167
  const focusedRoute = state.routes[state.index] as any;
168
- const focusedDescriptor = descriptors[focusedRoute.key] as any;
168
+ const focusedDescriptor = descriptors?.[focusedRoute.key] ?? ({} as any);
169
169
  const focusedOptions = focusedDescriptor.options;
170
170
  const shouldShowTabBar =
171
171
  focusedOptions.tabBarVisible !== false && !keyboardHidesTabBar;
@@ -265,7 +265,7 @@ export default function BottomTabBar({
265
265
  (data: any[]) => {
266
266
  return data?.map((route, index) => {
267
267
  const focused = route.params.name === focusedTab;
268
- const {options} = descriptors[route.key] as any;
268
+ const {options} = descriptors?.[route.key] ?? ({} as any);
269
269
  const onPress = () => {
270
270
  const event = navigation.emit({
271
271
  type: 'tabPress',
@@ -305,7 +305,7 @@ export default function BottomTabBar({
305
305
  return (
306
306
  <NavigationContext.Provider
307
307
  key={route.key}
308
- value={(descriptors as any)[route.key].navigation}>
308
+ value={(descriptors as any)?.[route.key]?.navigation}>
309
309
  <NavigationRouteContext.Provider value={route}>
310
310
  <BottomTabBarItem
311
311
  route={route}
@@ -455,9 +455,9 @@ export default function BottomTabBar({
455
455
  />
456
456
  </Animated.View>
457
457
 
458
- {renderTabItem(leftArr)}
458
+ {isFloating && renderTabItem(leftArr)}
459
459
  {isFloating && renderCenterComponent()}
460
- {renderTabItem(rightArr)}
460
+ {isFloating && renderTabItem(rightArr)}
461
461
  </View>
462
462
  </Animated.View>
463
463
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.92.1-rc.4",
3
+ "version": "0.92.1-rc.6",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {