我正在尝试为我的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'
}
}
}
}]
}
}
});
};
有人发现代码中有明显的缺陷吗? 谢谢