Hi <@UJBPFB3SN>, Is there a way to set a Destinati...
# compose
a
Hi @Ian Lake, Is there a way to set a Destination's arguments to take it from a
stringResource(...)
? Since
navArgument(...)
isn't a
@Composable
function, its not possible to do:
Copy code
composable(
    route = Screen.route + ...,
    arguments = listOf(
        navArgument("NAME") {
            defaultValue = stringResource(id = R.string.placeholder)
        },
    ),
) {
    ...
}
i
Generally, I'd strongly recommend against this approach at all. Instead, consider using
defaultValue = null
and then use
backStackEntry?.arguments?.getString("NAME") ?: stringResource(id = R.string.placeholder)
Keeping the Composables with the Composable as it were
a
ok! Thank you very much!