title: Attempt attach child that is not of type RNScreen
body: <p>I am getting this error in my application after recent upgrade from <code>react-navigation</code> v4 to v6.</p>
  <pre><code>Attempt attach child that is not of type RNScreen
  </code></pre>
  <p>Here is my Navigation for the application.</p>
  <pre><code>function switchNavigator() {
    return (
      &lt;NavigationContainer&gt;
        &lt;Stack.Navigator initialRouteName=&quot;loginFlow&quot;&gt;
          &lt;Stack.Screen name=&quot;loginFlow&quot; component={loginFlow} /&gt;
          &lt;Stack.Screen name=&quot;mainFlow&quot; component={mainFlow} /&gt;
        &lt;/Stack.Navigator&gt;
      &lt;/NavigationContainer&gt;
    );
  }
  </code></pre>