Generic question: How can I pass a lambda for a sc...
# compose
n
Generic question: How can I pass a lambda for a screen using Navigation? šŸ¤” Specific explanation: I’m creating a Generic Error screen which should have an option to ā€œRetryā€. So my plan was
if (error) navController.navigate(ERROR_SCREEN)
, but I’m stuck in how to pass this action to the ErrorScreen… Any thoughts?
z
I don't think navigating to a screen is a good idea (because it requires you to navigate back to retry) Instead, create a Composable error screen, and display that with a retry callback function
I am still learning Compose but this is how I do this
n
Make sense… That was my initial idea, I just didn’t want to handle the back press manually… But I guess it’s better
Sounds great šŸ˜‰