title: Ionic-React - setState doesn't cause re-render
body: <p>When I call <code>setMyState</code> within a <code>useEffect</code> hook, my understanding is react should re-run the logic to choose the component (either <code>MyPage</code> or <code>IonSpinner</code> in this case), but <code>MyPage</code> doesn't render unless I switch to a different tab and come back (using Ionic's IonTabs).</p>
  <p>I confirmed <code>setMyState</code> is running because it updates other parts of the application (ex. triggers a different <code>useEffect</code>) and I know <code>MyPage</code> isn't being rendered because I'm doing a <code>console.log()</code> on the first line of rendering <code>MyPage</code> and this log doesn't appear.</p>
  <p>Can someone help me with why this is happening?</p>
  <pre><code>&lt;IonApp&gt;
      &lt;IonReactRouter&gt;
          &lt;IonTabs&gt;
              &lt;IonRouterOutlet&gt;
                  &lt;Route exact path=&quot;/:tab(MyTab)&quot;&gt;
                      {myState ? &lt;MyPage /&gt; : &lt;IonSpinner /&gt;}
                  &lt;/Route&gt;
  ... more code ...
  </code></pre>
  <p>EDIT:</p>
  <p>Pretty sure it's a bug in Ionic? After <code>useEffect</code> runs <code>setMyState</code>, react does a render like it's supposed to but then the <code>IonRouterOutlet</code> has no children (none displayed in React Dev Tools).</p>
  <p>I traced this back to the <code>ReactRouterViewStack</code> calling <code>getChildrenToRender()</code> which creates <code>const viewItems</code>. This <code>viewItems</code> object is empty <code>{}</code> because the <code>viewStack</code> is empty <code>{}</code>. I don't know how the <code>viewStack</code> is meant to be populated so I'm not sure where to go from here, but I think <code>addViewItem</code> is not running?</p>
  <p>When I go to another tab and then back to this tab, everything renders correctly and the children to <code>IonRouterOutlet</code> are shown in React Dev Tools.</p>
  <p>Files:</p>
  <p><code>node_modules/@ionic/react/dist/index.esm.js</code></p>
  <p><code>node_modules/@ionic/react-router/dist/index.esm.js</code></p>