RNRF-Actions.popTo失败:“使用未知的routeName调用”

时间:2019-10-28 10:58:09

标签: react-native router flux

库版本

"react-native-router-flux": 4.1.0-beta.4  
"react": "16.8.3",  
"react-native": "^0.59.9"

我试图打电话给Actions.popTo(sceneKey),但它给了popTo called with an unknown routeName: pulsaScreen。我想弹出的愿望屏幕是pulsaScreen

当我登录Actions.prevState.routes并给出结果时:

[ { params: 
     { error: '',
       navigationBarStyle: { backgroundColor: '#FD6542', borderBottomWidth: 0 },
       leftButtonType: 'GO_TO_HOME_BUTTON',
       rightButtonType: 'CHAT_BUTTON_WITHOUT_LABEL',
       title: 'Beli Pulsa',
       navTransparent: false,
       titleStyle: 
        { .... },
       renderBackButton: null,
       renderLeftButton: 
        { '$$typeof': {},
          ... },
       renderRightButton: 
        { '$$typeof': {},
          ... },
       init: true,
       product_type: 1,
       type: 'reset',
       routeName: 'pulsaScreen' },
    routeName: 'pulsaScreen',
    key: 'id-1572259438287-3' },
  { params: 
     { error: '',
       navigationBarStyle: { backgroundColor: '#FD6542', borderBottomWidth: 0 },
       leftButtonType: 'BACK_BUTTON',
       rightButtonType: 'CHAT_BUTTON_WITHOUT_LABEL',
       title: 'Review',
       navTransparent: false,
       titleStyle: 
        { ... },
       renderBackButton: null,
       renderLeftButton: 
        { '$$typeof': {},
          .... },
       renderRightButton: 
        { '$$typeof': {},
          ... },
       init: true,
       routeName: 'reviewPulsaScreen' },
    routeName: 'reviewPulsaScreen',
    key: 'id-1572259438287-4' },
  { params: 
     { error: '',
       navigationBarStyle: { backgroundColor: '#FD6542', borderBottomWidth: 0 },
       title: 'Masukkan Pin',
       leftButtonType: 'BACK_BUTTON',
       rightButtonType: 'CHAT_BUTTON_WITHOUT_LABEL',
       navTransparent: false,
       titleStyle: 
        { .... },
       renderBackButton: null,
       renderLeftButton: 
        { '$$typeof': {},
          ... },
       renderRightButton: 
        { '$$typeof': {},
          ... },
       init: true,
       routeName: 'pinInputScene' },
    routeName: 'pinInputScene',
   ...
    key: 'id-1572259438287-5' 

pulsaScreen存在于我记录的路由堆栈中。

有什么主意吗?

1 个答案:

答案 0 :(得分:0)

直到现在,我还不知道答案。但是,我偶然使用了Actions.jump(),它按预期运行。

尽管在文档中,Actions.jump()仅可用于Tab