Closed huynqjmango360 closed 2 years ago
Hey, @huynqjmango360 are you using the hardware back button inside the bottom tab? Or are you using the hardware back button on the first stack screen?
@sashansk3 my ProductDetail screen is push from ProductList, it's child of bottom tab stack.
bottomTabs: { id: BottomTabs, options: { bottomTabs: { testID: 'Button-Tabs', }, }, children: [ { stack: { id: Screens.HomeStack, children: [ { component: { name: Screens.HomeScreen, options: { topBar: { visible: false, }, }, }, },
I have the same problem, after a few days of research I found a problem in the StackController.java on line 407.
Try to replace return stack.size() > 1;
with return stack.size() >= 1;
. This change fixed the hardware back button issue in my case.
I try to use HardwareBackButtonOptions config but instead of pop stack, android back hardware minimize app to back ground.
Navigation.push<ProductDetailProps>( componentId, { component: { name: Screens.ProductDetail, passProps: { product, }, options: { statusBar: { style: 'dark', animated: true, }, topBar: { visible: false, height: 0, }, layout: { componentBackgroundColor: 'transparent', }, hardwareBackButton: { popStackOnPress: true, dismissModalOnPress: true, }, animations: buildSharedElementAnimations(product.id), }, }, } );
Did i missing something here?
Im using RNN 7.28.0, RN 0.68.1, google pixel 5, android 13