@react-navigation/bottom-tabs 7.0.0-rc.34 → 7.0.0-rc.36

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/bottom-tabs",
3
3
  "description": "Bottom tab navigator following iOS design guidelines",
4
- "version": "7.0.0-rc.34",
4
+ "version": "7.0.0-rc.36",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -61,7 +61,7 @@
61
61
  "react-native": "0.74.5",
62
62
  "react-native-builder-bob": "^0.29.0",
63
63
  "react-native-safe-area-context": "4.10.1",
64
- "react-native-screens": "4.0.0-beta.9",
64
+ "react-native-screens": "4.0.0-beta.16",
65
65
  "typescript": "^5.5.2"
66
66
  },
67
67
  "peerDependencies": {
@@ -69,7 +69,7 @@
69
69
  "react": ">= 18.2.0",
70
70
  "react-native": "*",
71
71
  "react-native-safe-area-context": ">= 4.0.0",
72
- "react-native-screens": ">= 4.0.0"
72
+ "react-native-screens": ">= 4.0.0 || >= 4.0.0-beta.16"
73
73
  },
74
74
  "react-native-builder-bob": {
75
75
  "source": "src",
@@ -96,5 +96,5 @@
96
96
  ]
97
97
  ]
98
98
  },
99
- "gitHead": "458dac172e46ee9dd6c6e27ae23417d0d371e0d6"
99
+ "gitHead": "dfb56c62f21728a7e130945fd4e7b74e9c130fff"
100
100
  }
package/src/types.tsx CHANGED
@@ -35,6 +35,14 @@ export type BottomTabNavigationEventMap = {
35
35
  * Event which fires on long press on the tab in the tab bar.
36
36
  */
37
37
  tabLongPress: { data: undefined };
38
+ /**
39
+ * Event which fires when a transition animation starts.
40
+ */
41
+ transitionStart: { data: undefined };
42
+ /**
43
+ * Event which fires when a transition animation ends.
44
+ */
45
+ transitionEnd: { data: undefined };
38
46
  };
39
47
 
40
48
  export type LabelPosition = 'beside-icon' | 'below-icon';
@@ -123,6 +123,13 @@ export function BottomTabView(props: Props) {
123
123
  }
124
124
 
125
125
  const animateToIndex = () => {
126
+ if (previousRouteKey !== focusedRouteKey) {
127
+ navigation.emit({
128
+ type: 'transitionStart',
129
+ target: focusedRouteKey,
130
+ });
131
+ }
132
+
126
133
  Animated.parallel(
127
134
  state.routes
128
135
  .map((route, index) => {
@@ -160,6 +167,13 @@ export function BottomTabView(props: Props) {
160
167
  if (finished && popToTopAction) {
161
168
  navigation.dispatch(popToTopAction);
162
169
  }
170
+
171
+ if (previousRouteKey !== focusedRouteKey) {
172
+ navigation.emit({
173
+ type: 'transitionEnd',
174
+ target: focusedRouteKey,
175
+ });
176
+ }
163
177
  });
164
178
  };
165
179