title: React Native - Device back button handling
body: <p>I want to check if there are more than one screens are on stack when device back button is hit. If yes, I want to show previous screen and if no, I want to exit app.</p>
  <p>I have checked number of examples but those use <code>BackAndroid</code> and <code>Navigator</code>. But both of them are deprecated. <code>BackHandler</code> is replacement for <code>BackAndroid</code>. And I can show previous screen by using <code>props.navigation.goBack(null)</code>.</p>
  <p>But I am unable to find code for finding screen count in stack. I don't want to use deprecated <code>Navigator</code>!</p>