【发布时间】:2019-01-05 11:54:38
【问题描述】:
我第一次尝试为我的 react native 应用程序设置 React Native Navigation,我遇到了这个错误
undefined is not a function (near ... _reactNativeNavigation.Navigation.setRoot...)
我怀疑我设置根导航器的方式存在一些简单的错误。目前只有一个屏幕。
import { Navigation } from 'react-native-navigation';
import RedBall from './components/red-ball';
export default () => {
Navigation.registerComponent('RedBall', () => RedBall);
Navigation.setRoot({
root: {
bottomTabs: {
children: [{
component: {
name: 'RedBall',
passProps: {
text: 'This is the red ball screen'
},
options: {
bottomTab: {
text: 'Red Ball',
testID: 'RED_BALL'
}
}
}
}]
}
}
});
};
有人发现代码中有任何明显的缺陷吗? 谢谢
【问题讨论】:
标签: react-native react-native-navigation