You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**componentId**| Id of the screen which was popped |
213
213
214
-
## registerBottomTabSelectedListener
214
+
## registerBottomTabPressedListener
215
215
216
-
Invoked when BottomTab is selected by a user.
216
+
Invoked when a bottom tab is pressed by the user, including when [`selectTabOnPress`](options-bottomTab.mdx#selecttabonpress) is `false` (the selected tab does not change).
|**selectedTabIndex**| Index of the newly selected tab |
245
251
|**unselectedTabIndex**| Index of the previously selected tab |
246
252
253
+
Works with [custom bottom tab items](../docs/customBottomTabs.mdx) on iOS and Android.
254
+
255
+
## registerBottomTabLongPressedListener
256
+
257
+
Invoked when BottomTab is long pressed by a user. **iOS only.** Not emitted for [custom bottom tab items](../docs/customBottomTabs.mdx) — long press is handled on the native tab bar, which is hidden when every tab uses `bottomTab.component`.
Copy file name to clipboardExpand all lines: website/docs/api/options-bottomTab.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,8 @@ bottomTab: {
37
37
38
38
Native still owns selection, visibility, `drawBehind`, animations, and `dotIndicator`. Pair with [`bottomTabs.customRow`](options-bottomTabs.mdx#customrow) to style the floating row.
39
39
40
+
Tab press and selection [events](events) match native bottom tabs; long press is not available on custom items. See [Custom bottom tabs — Events](../docs/customBottomTabs.mdx#events).
Taps on custom tab items use the same native selection pipeline as the built-in tab bar. Use the standard [Navigation events](../api/events) listeners:
125
+
126
+
| Listener | Custom row |
127
+
| -------- | ---------- |
128
+
|[`registerBottomTabPressedListener`](../api/events#registerbottomtabpressedlistener)| Yes — every tap (iOS and Android) |
129
+
|[`registerBottomTabSelectedListener`](../api/events#registerbottomtabselectedlistener)| Yes — when the selected tab changes |
[`bottomTab.selectTabOnPress`](api/options-bottomTab.mdx#selecttabonpress): when `false`, **pressed** still fires; **selected** does not until you change the tab programmatically (for example via `bottomTabs.currentTabIndex`).
133
+
134
+
[`bottomTab.popToRoot`](api/options-bottomTab.mdx#poptoroot) and Android hardware-back tab history behave the same as with native tab items.
135
+
136
+
`registerBottomTabLongPressedListener` is **iOS-only** and is wired to the native `UITabBar` long-press gesture. With custom tabs the native bar is hidden and touches go to the custom row, so this listener does not fire for custom tab items.
137
+
122
138
## Custom row (`bottomTabs.customRow`)
123
139
124
140
When all tabs use custom components, RNN replaces the visible tab bar chrome with a **floating row** that hosts your React tab cells. Configure it with `bottomTabs.customRow` on the `bottomTabs` layout options.
0 commit comments