React Native navigation.goBack() problem

Hello everyone.
I encountered a trouble using StackNavigator.

The problem looks like below.

These are my navigators.
const AStack = createStackNavigator({
AA: AAScreen,

const BStack = createStackNavigator({
BA: BAScreen,
BB: BBScreen

Now, I am on AAScreen in AStack.
I clicked “gotoBBScreenButton” and now on BBScreen.
On BBScreen there is a “back” button.
When I click “back” button, I want to go back AAScreen but it goes back BAScreen.
My “back” button’s event is shown below.
onBackButton = {() => {this.props.navigation.goBack();} }

But when I click device back key (I use android phone), it goes back AAScreen.
How can I emulate device back key’s action?