我将在react组件之外使用react navigation
,所以我无法访问道具,我可以为navigate
做这件事,但我不知道如何为{ {1}}和reset
这是我对pop
的代码:
navigate
答案 0 :(得分:1)
首先在NavigationService中导入StackAction
import {
NavigationActions,
StackActions,
} from "react-navigation";
添加弹出和替换功能
function replace(routeName, params) {
_navigator.dispatch(
StackActions.replace({
routeName,
params
})
);
}
function pop(number = 1) {
_navigator.dispatch(
StackActions.pop({
n: number
})
);
}
注意:“弹出”具有要弹出多少个屏幕的参数。默认值为1表示当前屏幕
答案 1 :(得分:0)
与此相关,您可以使用导航,弹出,重置:
参考:
https://reactnavigation.org/docs/en/navigation-actions.html
https://reactnavigation.org/docs/en/navigation-actions.html
struct event *event_new(
struct event_base *,
evutil_socket_t,
short,
event_callback_fn,
void *
)