I started leaning react native and stuck at this issue:
Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager.
I checked on react-native-screen and @react-navigation repositories but exact solution that solves the issue.
Package.json
"dependencies": {
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.0",
"react": "17.0.2",
"react-native": "0.67.4",
"react-native-gesture-handler": "^2.3.2",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
App.js
<SafeAreaView style={styles.container}>
<NavigationContainer>
<Stack.Navigator initialRouteName="Categories"
screenOptions={{
unmountOnBlur: true,
}}>
<Stack.Screen name='Categories' component={Categories} />
</Stack.Navigator>
</NavigationContainer>
</SafeAreaView>