Actions.replace(key)在本机反应中不起作用,它给出错误,如错误所示

时间:2018-09-20 11:00:24

标签: react-native react-native-router-flux

The error generated like this when I am trying to replace scene in 
react native router flux.

Actions.replace('home') like this 
Give me solution what should I do to remove this error

It is not able to pop the previous scene or how can I remove scene 
from router 

在这种情况下,Actions.replace不适用于该主场景,而仅适用于它正在工作的另一个场景

TypeError: Converting circular structure to JSON
    at JSON.stringify (<anonymous>)
    at popPrevious (State.js:63)
    at reducer (Reducer.js:36)
    at Object.Navigator.router.getStateForAction (navigationStore.js:500)
    at NavigationContainer._this.dispatch (createNavigationContainer.js:315)
    at NavigationStore.dispatch (navigationStore.js:840)
    at NavigationStore.replace (navigationStore.js:908)
    at LoginScreen.js:92
    at tryCallOne (core.js:37)
    at core.js:123

1 个答案:

答案 0 :(得分:0)

Actions.home({type:'reset'})使用此方法,我们可以将路由器流量路由到主屏幕或登录屏幕,并在注销时也进行此操作Actions,login({type:'reset'}) 这样,您可以在路由器流量中重置路由