Error: There is no route defined for key Location. Must be one of: 'root','modal'

Author: tanerparcaliCreated Nov 29, 2022Updated Dec 3, 2022

Any ideas on this? Why am I getting this error? It's fine when I don't use Modal, but this is the error I get when I try to generate a Modal window.

"react-native": "0.70.6", with TypeScript template

"react": "18.1.0", "react-native": "0.70.6", "react-native-animatable": "^1.3.3", "react-native-gesture-handler": "^2.8.0", "react-native-reanimated": "^2.13.0", "react-native-router-flux": "^4.3.1", "react-native-safe-area-context": "^4.4.1", "react-native-screens": "^3.18.2",

<Router>
      <Modal>
        <Stack key="root" hideNavBar>  
          <Scene key="Control" initial component={Control} type="reset" back={false} />
          <Scene tabs={true} showLabel={false} hideNavBar tabBarStyle={styles.tabBar} type="reset">
            <Scene key="Account" component={AccountPage} hideNavBar icon={AccountIcon} title='Account' lazy on={() => appState.setCurrentScreen('AccountPage')} />
          </Scene>
        </Stack>
        <Scene  key="modal" component={ItemList} /> 
        </Modal>
    </Router>

Simulator Screen Shot - iPhone 14 - 2022-11-29 at 20 08 49

Source: aksonov/react-native-router-flux