Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Navigation Material] Remove usages of undefined Destinations.Home string from code samples in documentation #1231

Conversation

patrykmichalik
Copy link
Contributor

@patrykmichalik patrykmichalik commented Jul 7, 2022

In the documentation for Navigation Material, the following code sample is present:

@Composable
fun MyApp() {
    val bottomSheetNavigator = rememberBottomSheetNavigator()
    val navController = rememberNavController(bottomSheetNavigator)
    ModalBottomSheetLayout(bottomSheetNavigator) {
        NavHost(navController, Destinations.Home) {
           composable(route = "home") {
               ...
           }
           bottomSheet(route = "sheet") {
               Text("This is a cool bottom sheet!")
           }
        }
    }
}

In the sixth line, Destinations.Home is used, but no such thing is defined anywhere in the documentation, making the code sample somewhat unclear. This pull request replaces NavHost(navController, Destinations.Home) with NavHost(navController, "home") to ensure that the code samples in the Navigation Material documentation donʼt include references to any undefined items. This is consistent with the documentation for the Navigation Animation library.

@bentrengrove bentrengrove requested a review from jossiwolf Jul 7, 2022
@ianhanniballake ianhanniballake self-requested a review Jul 13, 2022
@ianhanniballake ianhanniballake merged commit 24d38c7 into google:main Jul 13, 2022
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants