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
default BackHandler from newly stacked drawer tab shouldn't be of higher priority than the root BackHandler implemented in drawer component
Actual behaviour
when new scene stacked on the current scene (i.e. when I move using Actions.settingTab() from Home) from it seems that there is a new default BackHandler being attached to that scene (setting) with a default behaviour of Actions.pop(), The only way I can think of to override this is to add backHandler to every scene which is counter-intuitive of what I'm trying to achieve (BackHandler centralized in the drawer to handle any hardware back button press on any scene other than login scene).
At this point all the logical scene movements are working as expected, however, due to the default BackHandler being called and just doing Actions.pop() to get back to Home, the tab highlight is not moved back to Home because setState({currentTab:'Home'}) was never called.
Any Idea on how to disable to default handler or to do a workaround without adding individual backhandler to each scene in the tab?
The text was updated successfully, but these errors were encountered:
UPDATE: turns out this problem only occurs when I'm auto logged in (i.e. skipped the Auth stack and straight into the Main stack), it seems something went wrong between the reloading and componentWillUnmount or componentDidMount not being called and BackHandlers from previous reloads collide somehow.
Because if I try this scenario:
login --> Setting/Help/QR tab --> hardware back to Home it doesn't cause the problem
but if I do:
autoLogin(login using stored token) --> Setting/Help/QR tab --> hardware back to Home the default BackHandler will be called, but if I press back once again, the desired BackHandler is called and I'm logged out, then if I try to login again, everything works perfectly!
not related to RNRF, problem was with componentDidMount called again after hot reloading without componentWillUnmount ever called causing listener stack to act weird.
Version
Tell us which versions you are using:
Expected behaviour
default BackHandler from newly stacked drawer tab shouldn't be of higher priority than the root BackHandler implemented in drawer component
Actual behaviour
when new scene stacked on the current scene (i.e. when I move using Actions.settingTab() from Home) from it seems that there is a new default BackHandler being attached to that scene (setting) with a default behaviour of
Actions.pop()
, The only way I can think of to override this is to add backHandler to every scene which is counter-intuitive of what I'm trying to achieve (BackHandler centralized in the drawer to handle any hardware back button press on any scene other than login scene).Steps to reproduce
So here is the routes I'm working with:
and this is the BackHandler from my NavDrawer:
At this point all the logical scene movements are working as expected, however, due to the default BackHandler being called and just doing
Actions.pop()
to get back to Home, the tab highlight is not moved back to Home because setState({currentTab:'Home'}) was never called.Any Idea on how to disable to default handler or to do a workaround without adding individual backhandler to each scene in the tab?
The text was updated successfully, but these errors were encountered: