ex-navigation
ex-navigation copied to clipboard
importing NavigationProvider throws undefined is not an object (evaluating PropTypes.shape in NavigationPropTypes.js:30:26)
Hi there!
Running into this issue when doing:
import {
NavigationProvider,
StackNavigation,
createRouter
} from '@expo/ex-navigation';

Here is my App.js
import React from 'react';
import { AppRegistry } from 'react-native';
import Expo from 'expo';
import {
NavigationProvider,
StackNavigation,
createRouter
} from '@expo/ex-navigation';
import Home from './views/landing/Home';
const Router = createRouter(() => ({
home: () => Home,
}));
class App extends React.Component {
render() {
return (
<NavigationProvider router={Router}>
<StackNavigation initialRoute={Router.getRoute('home')} />
</NavigationProvider>
);
}
}
AppRegistry.registerComponent('Dusato', ()=> App);
This is my package.json:
{
"name": "dusato",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.6.0",
"jest-expo": "^22.0.0",
"react-test-renderer": "16.0.0-beta.5"
},
"presets": [
"react-native-stage-0/decorator-support"
],
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/ex-navigation": "^2.11.2",
"babel-preset-react-native-stage-0": "^1.0.1",
"expo": "^22.0.2",
"react": "16.0.0-beta.5",
"react-native": "^0.49.5",
"react-native-elements": "^0.18.0",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
}
}
Would be super grateful for any insight!
Sam
this is happening on 4.0.0
the master version is correct
I'm getting the same issue. Is there any way around this?
use 3.1.0
Thanks!
So does this mean version 4.0.0 is broken and should not be used?
@sibelius same issue with 3.1.0. please help me. "dependencies": { "@expo/ex-navigation": "3.1.0", "babel-preset-react-native-stage-0": "^1.0.1", "react": "16.0.0", "react-native": "0.50.4", "react-native-vector-icons": "^4.0.1", "react-navigation": "^1.0.0-beta.21" },
@femiveys there doesn't seem to be a 4.0.0 of this package. latest version is 3.1.0: https://github.com/expo/ex-navigation/commit/98b1c013f06db67d0019f4191388803b28af2719
@rahulbhankar786 3.1.0 should fix this specific issue. Check you really are on that version and it's the exact same error as displayed here.
@elie222 thanks. have resolved this problem.
@elie222 @rahulbhankar786 actually, there is a 4.0.0
version of this package published on npm. This version adds iPhone X support: https://www.npmjs.com/package/@expo/ex-navigation
I have the exact same problem that @shenders13 has posted.
What I find weird is that using the following deps on a brand new project, it works without any friction:
"dependencies": {
"@expo/ex-navigation": "4.0.0",
"react": "16.0.0-alpha.12",
"react-native": "0.47.2"
},