reset action is removed from NavigationActions and there is StackActions specific to StackNavigator in v2 of react-navigation. StackActions 是一个对象,其中包含用于生成操作的方法特定于基于堆栈的导航器.它的方法扩展了NavigationActions中可用的操作. StackActions is an object containing methods for generating actions specific to stack-based navigators. Its methods expand upon the actions available in NavigationActions.支持以下操作: 重置-用新状态替换当前状态Reset - Replace current state with a new state 替换-用另一条路线替换给定键处的一条路线Replace - Replace a route at a given key with another route 推送-在堆栈顶部添加一条路线,然后向前浏览Push - Add a route on the top of the stack, and navigate forward to it 弹出-导航回到以前的路线Pop - Navigate back to previous routes PopToTop -导航到堆栈的顶部路线,忽略所有其他路线PopToTop - Navigate to the top route of the stack, dismissing all other routes 这篇关于未定义不是函数(评估'_reactNavigation.NavigationActions.reset')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-11 20:50