Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

importing NavigationProvider throws undefined is not an object (evaluating PropTypes.shape in NavigationPropTypes.js:30:26) #497

Open
shenders13 opened this issue Nov 5, 2017 · 10 comments

Comments

@shenders13
Copy link

shenders13 commented Nov 5, 2017

Hi there!

Running into this issue when doing:

import {
  NavigationProvider,
  StackNavigation,
  createRouter
} from '@expo/ex-navigation';

screen shot 2017-11-05 at 2 06 46 pm

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

@sibelius
Copy link
Contributor

sibelius commented Nov 6, 2017

this is happening on 4.0.0

the master version is correct

@mattcleary55
Copy link

I'm getting the same issue. Is there any way around this?

@sibelius
Copy link
Contributor

sibelius commented Nov 6, 2017

use 3.1.0

@mattcleary55
Copy link

Thanks!

@femiveys
Copy link

So does this mean version 4.0.0 is broken and should not be used?

@rahulbhankar786
Copy link

@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"
},

@elie222
Copy link
Contributor

elie222 commented Dec 4, 2017

@femiveys there doesn't seem to be a 4.0.0 of this package. latest version is 3.1.0:
98b1c01

@elie222
Copy link
Contributor

elie222 commented Dec 4, 2017

@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.

@rahulbhankar786
Copy link

@elie222 thanks. have resolved this problem.

@rpereira
Copy link

rpereira commented Dec 6, 2017

@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"
        },

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants