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
Bottom Navigation - Not able to prevent User action or when user press any tab then registerBottomTabPressedListener this is envoked after tab moved
#8036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
When using Bottom Tabs in React Native Navigation, the registerBottomTabPressedListener is triggered after the tab is already selected.
This means:
The screen transition already occurs before we can react.
We cannot prevent the tab from opening based on logic (e.g., user not allowed, show popup, etc.).
What We Need:
Intercept the tab press before navigation happens.
Prevent navigation to a specific tab under certain conditions (e.g., user not logged in).
Instead of navigating, we want to show a popup or alert explaining why the tab is blocked.
What was the expected behaviour?
When a user taps on a bottom tab, you want:
To intercept the tab press before navigation happens.
Prevent the navigation to certain tabs under specific conditions (e.g., user not logged in, permission not granted).
Instead of navigating, show a custom popup/message/alert explaining why access to that tab is restricted.
Was it tested on latest react-native-navigation?
I have tested this issue on the latest react-native-navigation release and it still reproduces.
What happened?
Problem:
When using Bottom Tabs in React Native Navigation, the registerBottomTabPressedListener is triggered after the tab is already selected.
This means:
The screen transition already occurs before we can react.
We cannot prevent the tab from opening based on logic (e.g., user not allowed, show popup, etc.).
What We Need:
Intercept the tab press before navigation happens.
Prevent navigation to a specific tab under certain conditions (e.g., user not logged in).
Instead of navigating, we want to show a popup or alert explaining why the tab is blocked.
What was the expected behaviour?
When a user taps on a bottom tab, you want:
To intercept the tab press before navigation happens.
Prevent the navigation to certain tabs under specific conditions (e.g., user not logged in, permission not granted).
Instead of navigating, show a custom popup/message/alert explaining why access to that tab is restricted.
Was it tested on latest react-native-navigation?
Help us reproduce this issue!
In what environment did this happen?
React Native Navigation version: "8.0.0",
React Native version: "0.76.0"
Has Fabric (React Native's new rendering system) enabled: (yes/no) yes
Node version: 20.0.0
The text was updated successfully, but these errors were encountered: