Closed zhuchaowe closed 8 years ago
ok , I fix this Exception use
import TabNavigator from 'react-native-tab-navigator'
instead of
var TabNavigator = require("react-native-tab-navigator")
For people reading this issue: I believe that import
and export
changed in Babel 6, and react-native 0.16 is the first version of RN to use Babel 6.
The thing that changed is that when you write export default Foo
, this sets exports.default = Foo
and doesn't set exports = Foo
anymore. This means that if you try to require react-native-tab-navigator
, you need to access require('react-native-tab-navigator').default
or write import 'react-native-tab-navigator'
.
2015-12-06 15:39:32.406 [error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
I got this Exception when use
<TabNavigator></TabNavigator>
, in react-native 0.16.0