最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Issue with navigating to a deep nested route using CommonActions.reset in React Navigation - Stack Overflow

programmeradmin1浏览0评论

I am trying to navigate to RouteD using CommonActions.reset in React Navigation, but the navigation works inconsistently. Sometimes it successfully navigates, but most of the time, it fails.

        navigation.dispatch(
CommonActions.reset({
    index: 0,
    routes: [
        {
            name: 'RouteA',
            state: {
                index: 0,
                routes: [
                    {
                        name: 'RouteB',
                        state: {
                            index: 3,
                            routes: [
                                { name: 'RouteC1' }, // This route is conditional
                                { name: 'RouteC2' },
                                { name: 'RouteC3' },
                                {
                                    name: 'RouteD',
                                    params: {
                                       data: []
                                    }
                                },
                                { name: 'RouteE' }
                            ]
                        }
                    }
                ]
            }
        }
    ]
})
);

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论