We added this piece of code to both the software back button press and the hardware back button press in react native. Now in the case of the software back button press thin