Hi everyone, I have a small question. I am using c...
# decompose
d
Hi everyone, I have a small question. I am using compose multiplatfrom with decompose. I use components instead of viewmodels. I want to show a confirmation dialog. I am wondering. What is better practice, using compose's
AlertDialog
with its ui state (I would probably place the state in the component as value and consume it as compose state) or using slot navigation decompose provides? So 2 options: 1. compose's
AlertDialog
with just boolean state
isDialogOpen
2. Decompose's
childSlot
with
SlotNavigation
Which approach makes more sense. Seems simpler to me to use just an alert dialog
a
I think both options are valid. For simple "confirmation" cases a state flag should work fine as well. Child Slot is useful when you need the navigation to be persistent (i.e. saved over process death), or when your dialog has business logic, or when you need instance retaining (aka ViewModel) in the dialog.
d
Cool, I totally agree with this, thank you @Arkadii Ivanov
👍 1