0

我正在努力让 Node Package react-native-navigation 在我的项目中工作。但是,当我尝试运行我的应用程序时,我遇到了一个令人讨厌的错误,我似乎无法追踪。帮助表示赞赏。

错误:

错误者

index.js:

import Navigation from 'react-native-navigation';
import SideBar from './sidebar';
import Meetups from './meetups';

export default function() {
    Navigation.registerComponent('inbetween.sidebar', () => SideBar);
    Navigation.registerComponent('inbetween.meetups', () => Meetups);
}

应用程序.js:

import Navigation from 'react-native-navigation';
import registerScreens from './screens';

registerScreens();

export default class App {

}

Navigation.startSingleScreenApp({
  screen: {
    screen: 'inbetween.meetups',
    title: 'Meetups',
    navigatorStyle: {},
    navigatorButtons: {}
  },
  drawer: {
    left: {
      screen: 'inbetween.sidebar',
      passProps: {}
    },
    disableOpenGesture: false
  },
  passProps: {},
  animationType: 'slide-down'
});

index.android.js

import App from './src/App';
AppRegistry.registerComponent('App', () => App);

侧边栏:

import React from 'react';
import { View, Text } from 'react-native';

class SideBar extends React.Component {
  render() {
    return (
      <View>
         <Text>Navigation List Here</Text> 
      </View>
    );
  }
};

export default SideBar;

聚会:

import React from 'react';
import { View, Text } from 'react-native';

class Meetups extends React.Component {
  render() {
    return (
      <View style>
        <Text>Meetup List Here</Text>
      </View>
    );
  }
};

export default Meetups;
4

1 回答 1

1

您需要Navigation像这样导入: import {Navigation} from 'react-native-navigation';

于 2017-07-19T16:32:22.713 回答