title: clear stack when navigating to nested stack navigator inside bottom tab navigator
body: <h1><strong>Current Behavior</strong></h1>
  <p>My react-native application consists of a BottomTabNavigator that contains several StackNavigators. A simplified example of my structure looks like this</p>
  <p><strong>userLoggedIn or signinSkiped ?</strong> (</p>
  <p>BottomTab</p>
  <ul>
  <li>Tab 1
  <ul>
  <li><p>Stack</p>
  <ul>
  <li><p>Screen 1</p>
  </li>
  <li><p>Screen 2</p>
  </li>
  </ul>
  </li>
  </ul>
  </li>
  <li>Tab 2
  <ul>
  <li><p>Stack</p>
  <ul>
  <li><p>Screen 1</p>
  </li>
  <li><p>Screen 2</p>
  </li>
  </ul>
  </li>
  </ul>
  </li>
  </ul>
  <p>) : ( Stack</p>
  <ul>
  <li><p>SigninScreen</p>
  </li>
  <li><p>RegisterScreen</p>
  </li>
  </ul>
  <p>)</p>
  <h1>**My problem is: **</h1>
  <ol>
  <li>I log in into my application</li>
  <li>I am on Screen 1 of the Tab 1.</li>
  <li>From the Screen 1 of the Tab 1 i navigate to Screen 2 of the Tab 1 on the press button.</li>
  <li>From the Screen 2 of the Tab 1 i navigate to Screen 2 of the Tab 2 on the press button.</li>
  <li>I log out from my application</li>
  <li>I am on SigninScreen</li>
  <li>I click on the button &quot;signinSkip&quot; on the SigninScreen (signinSkiped = true)</li>
  <li>I am on the Screen 1 of the Tab 1</li>
  <li>I click on Tab 2</li>
  <li>Screen 2 of the Tab 2 is displayed</li>
  </ol>
  <h1>**Expected behavior: **</h1>
  <p>When I click on Tab 2 as described in the step 9 above, Screen 1 of the Tab 2 should be displayed and not the Screen 2.</p>
  <p>It works as expected, if I do following steps:</p>
  <ol>
  <li>I sign in into my application</li>
  <li>I am on the Screen 1 of the Tab 1</li>
  <li>I click on Tab 2 and I'm on the Screen 1 of the Tab 2</li>
  <li>From the Screen 1 of the Tab 2 i navigate to Screen 2 of the Tab 2 on the press button.</li>
  <li>I log out from my application</li>
  <li>I am on SigninScreen</li>
  <li>I click on the button &quot;signinSkip&quot; on the SigninScreen (signinSkiped = true)</li>
  <li>I am on the Screen 1 of the Tab 1</li>
  <li>I click on Tab 2</li>
  <li>Screen 1 of the Tab 2 is displayed</li>
  </ol>
  <p>I assume, it has to do with refreshing of stack after logging out, but I'm not sure.
  i would really appreciate your help</p>
  <p><strong>I tried following:</strong></p>
  <p>Navigate from Screen 2 to Screen 1 of the Tab 2 if the user loggs out (within the onAuthStateChanged listener). I get the expected result, but it leads to the error: Can't perform a React state update on an unmounted component</p>