fix: handle in-page go back when there's no history
fix: handle in-page go back when there's no history

fixes #7852

react-community/react-navigation,react-community/react-navigation,react-community/react-navigation