小编Aru*_*mar的帖子

不推荐使用React-Native Navigator,并且已从此程序包中删除

我收到以下错误.

Navigator已弃用,已从此包中删除.它现在可以从react-native-deprecated-custom-components安装和导入,而不是react-native.在http://facebook.github.io/react-native/docs/navigation.html上了解替代导航解决方案

然后我会更新react-native-deprecated-custom-components包但问题没有解决

的package.json

"dependencies": {
    "react": "16.0.0-alpha.6",
    "react-native": "0.44.2",
    "react-native-deprecated-custom-components": "^0.1.0",
    "sendbird": "^3.0.30"
},
Run Code Online (Sandbox Code Playgroud)

main.js

var React = require('react-native')
var {
  Navigator,
  StyleSheet
} = React;

var Login = require('./components/login');

import NavigationExperimental from 'react-native-deprecated-custom-components';

var ROUTES = {
  login: Login
};

module.exports = React.createClass({
  renderScene: function(route, navigator) {
    var Component = ROUTES[route.name];
    return <Component route={route} navigator={navigator} />;
  },
  render: function() {
    return (

      <NavigationExperimental.Navigator
        style={ styles.container }
        initialRoute={ {name: 'login'} }
        renderScene={this.renderScene}
        configureScene={ () => …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-android react-native-ios react-navigation

6
推荐指数
1
解决办法
1万
查看次数