javascript - React-navigation error when trying to set up after installing - Element type is invalid -
i new react-native fiddling around , came across need of navigation. however, after following directions on reactnavigation.org emulator spewing out nonsensical error me. google had no sadly time.
element type invalid: expected string (for built-in components) or class/function (for composite components) got: object. forgot export component file it's defined in.
check render method of
awakeindevapp
.
code simplistic example have:
import react 'react'; import { appregistry, text, } 'react-native'; import { stacknavigator } 'react-navigation'; class homescreen extends react.component { static navigationoptions = { title: 'welcome', }; render() { return <text>hello, navigation!</text>; } } const eproj = stacknavigator({ home: { screen: homescreen }, }); appregistry.registercomponent('eproj', () => eproj);
dependencies:
"dependencies": { "expo": "^20.0.0", "react": "16.0.0-alpha.12", "react-native": "^0.47.0", "react-navigation": "^1.0.0-beta.11" }
it looks don't need appregistry.registercomponent('eproj', () => eproj);
expo try exporting module : export default eproj
here link similar problem
Comments
Post a Comment