美文网首页
RN中navigator的使用

RN中navigator的使用

作者: mark666 | 来源:发表于2017-05-27 14:26 被阅读186次
    800B6AB6-0BAD-41A1-A525-A35EDC04E2D0.png

    最近在使用RN中发现navigator已经被废弃了,不知道facebook搞什么,网上百度了一下没找到合适的tips,试了几个也没成功,最后在GitHub上找打了相应的解决方案。
    https://github.com/react-community/react-navigation/issues/1328

    步骤一:
    npm install react-native-deprecated-custom-components --save
    步骤二:
    在项目中引用
    import NavigationExperimental from 'react-native-deprecated-custom-components';
    步骤三:
    使用

    export default class App extends Component {
    render() {
    return (
    <NavigationExperimental.Navigator
    // Default to movies route
    initialRoute={{ name: 'movies' }}
    // Use FloatFromBottom transition between screens
    configureScene={(route, routeStack) => NavigationExperimental.Navigator.SceneConfigs.FloatFromBottom}
    // Pass a route mapper functions
    renderScene={RouteMapper}
    />
    );
    }
    }
    

    相关文章

      网友评论

          本文标题:RN中navigator的使用

          本文链接:https://www.haomeiwen.com/subject/btdqfxtx.html