I'm facing this issue in React-Native Drawer Navigation since last two days. kindly help me to resolve this issue.. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. Here is App.js code:
import { StyleSheet, Text, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
function ScreenA({ navigation }) {
return (
<View style={styles.container}>
<Text style={styles.text}>Screen A</Text>
</View>
);
}
function ScreenB({ navigation }) {
return (
<View style={styles.container}>
<Text style={styles.text}>Screen B</Text>
</View>
);
}
function ScreenC({ navigation }) {
return (
<View style={styles.container}>
<Text style={styles.text}>Screen C</Text>
</View>
);
}
const Drawer = createDrawerNavigator();
export default function DrawerScreen({ navigation }) {
return (
<NavigationContainer>
<Drawer.Navigator>
<Drawer.Screen name='Screen A' component={ScreenA} />
<Drawer.Screen name='Screen B' component={ScreenB} />
<Drawer.Screen name='Screen C' component={ScreenC} />
</Drawer.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
text: {
fontSize: 30,
fontWeight: 'bold',
},
});
Following Dependenciew are installed:
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/drawer": "^6.3.1",
"@react-navigation/native": "^6.0.8",
"install": "^0.13.0",
"npm": "^8.5.4",
"react": "17.0.2",
"react-native": "0.67.3",
"react-native-gesture-handler": "^2.3.1",
"react-native-reanimated": "^2.4.1",
"react-native-safe-area-context": "^4.1.2",
"react-native-screens": "^3.13.1"
},````