Skip to content

[BUG] Navigation功能相同代码在1.6.0及以下正常,1.6.1开始异常 #375

@xuhuan

Description

@xuhuan

Describe the bug
在不变动代码的情况下,版本1.6.0及以下导航都是正常的,初始化后能正常跳转到默认页。将版本升级到1.6.1或者1.6.2,导航初始化后页面空白,不会进行跳转到默认页。代码显示进行跳转也不会进行。

PreComposeApp {
    val navigator = rememberNavigator()
    NavHost(
        // Assign the navigator to the NavHost
        navigator = navigator,
        // Navigation transition for the scenes in this NavHost, this is optional
        navTransition = NavTransition(),
        // The start destination
        initialRoute = "/home",
    ) {

        打印NavHost日志,所有版本都能打印
        // Define a scene to the navigation graph
        scene(
            // Scene's route path
            route = "/home",
            // Navigation transition for this scene, this is optional
            navTransition = NavTransition(),
        ) {
            打印scene日志,升级到1.6.1及以上这里日志打印不出来
            Text(text = "Hello!")
        }
    }
}

通过日志打印发现1.6.0及以下情况scene里的日志能正常打印,能跳转,内容显示正常。
升级到1.6.1及以上scene里的日志不会打印,且页面空白,不会跳转到默认页。

这种有人碰到过么?大概是什么原因导致的?感谢各位的回复🙏
@Tlaster

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions