Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element type is invalid #5

Open
kitsune7 opened this issue Aug 9, 2017 · 0 comments
Open

Element type is invalid #5

kitsune7 opened this issue Aug 9, 2017 · 0 comments

Comments

@kitsune7
Copy link

kitsune7 commented Aug 9, 2017

I get the following error message when I try to run my app:

Element type is invalid: expected a string (for built-in components) or a class/function
(for composite components) but got: object.

Here is the relevant code:

/* index.android.js */
import { AppRegistry } from 'react-native'
import App from './app'

AppRegistry.registerComponent('Lifey', () => App)



/* app/index.js */
import React from 'react'
import { Root } from './config/router'

const App = () => <Root />

export default App



/* package.json */
{
  "name": "Lifey",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "menu": "adb shell input keyevent KEYCODE_MENU"
  },
  "dependencies": {
    "babel-preset-react-native-stage-0": "^1.0.1",
    "prop-types": "^15.5.10",
    "react": "16.0.0-alpha.12",
    "react-native": "0.46.1",
    "react-native-background-upload": "^3.0.0-beta",
    "react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
    "react-native-fs": "^2.3.3",
    "react-native-video": "^1.0.0",
    "react-navigation": "^1.0.0-beta.11"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "1.9.2",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12"
  },
  "jest": {
    "preset": "react-native"
  }
}

I've tried having babel-preset-react-native-stage-0 under devDependencies instead of dependencies with the same result.

Everything works in I change the line that says import App from './app' in index.android.js to import App from './app/index', but it should be working without having to include index in the import, which is why I'm confused.

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

No branches or pull requests

1 participant