Does anyone know how to pass arguments to the star...
# compose
d
Does anyone know how to pass arguments to the start destination of a nested graph?
i
Well there's two things to keep in mind: • Any arguments you pass to the graph itself will automatically be sent to the start destination of the graph • You can navigate() with the route of any destination, so you can navigate directly to the start destination with whatever arguments you want I think we missed add the arguments/deeplinks arguments on the
navigation
element (which is going to make that first approach much more difficult): https://developer.android.com/reference/kotlin/androidx/navigation/compose/package-summary?hl=en#navigation - do you mind filing a bug so we can make sure those are included there? https://issuetracker.google.com/issues/new?component=409828
d
Filed here 🙂 https://issuetracker.google.com/issues/182545357
Any arguments you pass to the graph itself will automatically be sent to the start destination of the graph
does this means we have to declare the args on both the graph and the destination, or just one of them?
i
Only on the one that has those arguments in it's route. In Navigation Compose, navigating directly to the destination you want is generally going to centralize the definition of arguments and where you use them better, so the later solution is going to be the better choice almost every time
👍 1