I'm currently working on a simple "hello-world" type project and it works fine on both Android and UWP up until i use import { createStackNavigator } from 'react-navigation-stack';
in App.js
. The app still works in Android but in UWP the app screen is just white, and the chrome debugger gives me the following error messages:
...\ReactNative\MyApp_ReactNative\node_modules\react-native-windows\Libraries\Core\ExceptionsManager.js:86 Cannot read property 'Direction' of undefined
...\MyApp_ReactNative\node_modules\react-native-windows\Libraries\Core\ExceptionsManager.js:86 Module AppRegistry is not a registered callable module (calling runApplication)
I have been struggling with this problem for days now and I simply can't find any solutions to this. I am suspecting that the vnext version of react-native-windows does not support react-navigation-stack, or that maybe there's a previous version of react-navigation-stack I need to use for it to work with UWP.
I am completely new to React, and React Native, so please keep explanations somewhat simple . To reproduce, follow this guide https://github.com/microsoft/react-native-windows/blob/master/vnext/docs/GettingStarted.md, and then the first part of https://facebook.github.io/react-native/docs/navigation untill you get to the part about react-navigation-stack. If there's any more info I can give that will be helpful I can gladly provide it.
Here's my package.json
file:
{
"name": "MyApp_ReactNative",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "^0.60.0",
"react-native-gesture-handler": "^1.5.1",
"react-native-reanimated": "^1.4.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-windows": "0.60.0-vnext.74",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3",
"rnpm-plugin-windows": "^0.3.8"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/runtime": "^7.7.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.6.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.57.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}