I have tried to search for a solution for this problem a while now without success. My project is managed by expo and it contains a simple stack navigator. It works fine on android devices but it doesn't on ios devices. I created the stack navigator using this documentation: https://reactnavigation.org/docs/getting-started/ . The documentation says that I should install the pods but I am not able to as I don't have a mac. Could it be nonfunctional because the pods are not installed and how could the problem be solved? Help would be much appreciated!
This is my app.js just in case it is needed:
import * as React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import StartingScreen from './screens/StartingScreen';
import LogInScreen from './screens/LogInScreen';
import RegisterScreen from './screens/RegisterScreen';
const Stack = createStackNavigator();
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }} initialRouteName="StartingScreen" >
<Stack.Screen name="StartingScreen" component={StartingScreen} />
<Stack.Screen name="LogInScreen" component={LogInScreen} />
<Stack.Screen name="RegisterScreen" component={RegisterScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
There seems to be nothing wrong with your code. In Expo-managed projects you do not neet (and can not) make pod install as the Expo project contains already all available native code. Expo does contain react-navigation, but what might be the issue with your problem is a version mismatch. If you installed react-navigation with npm directly you get the latest version which might not match the version that is included in Expo. This is why you should only install with expo install instead of npm install. You can try to remove the libs and re-install them with expo.
If this is not the issue it would help others to answer if you would mention what exactly does not work in iOS.