2016-09-14 9 views
0

React Native + Reduxでは、私はリアクションネイティブドロワーhttps://github.com/root-two/react-native-drawerを持っていますが、NavigationExperimental、より具体的にはNavigationCardStackを使用してナビゲーションボタンを実装しようとしています。だから私は引き出しに3つのボタンを作成し、それらの間をナビゲートしようとするとエラーが発生します:ProfilePageボタンを押してからHomePageボタンを押した後にもう一度ProfilePageを押すとエラーになります)React Native:NavigationExperimentalを使用してReact Native Drawerのナビゲーションを正しく実装するにはどうすればよいですか?

何が問題なのですか?私は正しくナビゲートしていますか?そうでない場合は、React Native Drawerのナビゲーションボタンを使用してシーン間をナビゲートする適切な方法は何ですか?ここで

は私のセットがアップしている:リアクトネイティブ引き出しのナビゲーションボタンの押しに_handleNavigate(route)を使用して

_renderScene (props) { 
    const { route } = props.scene 

    return (
     <route.component _handleNavigate={this._handleNavigate} actions={this.props}/> 
    ) 
    } 

    _handleBackAction() { 
    if (this.props.navigation.index === 0) { 
     return false 
    } 
    this.props.popRoute() 
    return true 
    } 

    _handleNavigate(action) { 
    switch (action && action.type) { 
     case 'push': 
     this.props.pushRoute(action.route) 
     return true 
     case 'back': 
     case 'pop': 
     return this._handleBackAction() 
     default: 
     return false 
    } 
    } 

    <Drawer 
    content={<DrawerPanel {...this.props} _handleNavigate={this._handleNavigate}/>} 
    openDrawerOffset={100} 
    ref={(ref) => this._drawer = ref} 
    type='static' 
    tweenHandler={Drawer.tweenPresets.parallax} 
    tapToClose 
    acceptPan 
    negotiatePan 
    > 
    <NavigationCardStack 
     direction='horizontal' 
     navigationState={this.props.navigation} 
     onNavigate={this._handleNavigate} 
     renderScene={this._renderScene} 
    /> 
    </Drawer> 

、これはrouteがフォーマットされる方法である:

const route = { 
    group: { 
    type: 'push', 
    route: { 
     key: 'profilepage', 
     title: 'ProfilePage', 
     component: ProfilePage, 
     direction: 'horizontal', 
    }, 
    } 
} 

そして、 .pushおよび.popは、naviReducer.js

01で処理されます。

答えて

0

hereと私の答えを確認してください。あなたの問題に合っているかどうかを教えてください。

関連する問題