当我尝试运行导航时,我收到一个错误:
例外:元素类型无效:需要一个字符串(对于内置组件)或一个类/函数(对于复合组件),但得到:对象。检查
Navigator
.
我的代码:
import React, { Component } from 'react';
import {
AppRegistry,
Navigator
} from 'react-native';
import App from './app/App'
export default class MyApp extends Component {
renderScene (route, navigator) {
if (route.name === 'App') {
return <App navigator={navigator} {...route.passProps} />
}
}
configureScene (route) {
return Navigator.SceneConfigs.FloatFromBottom
}
render () {
return (
<Navigator
configureScene={ this.configureScene.bind(this) }
style={{ flex: 1, backgroundColor: 'white' }}
initialRoute={{ name: 'App' }}
renderScene={ this.renderScene.bind(this) }
/>
)
}
}
AppRegistry.registerComponent('MyApp', () => MyApp);
请问你能帮帮我吗?