The main issue in the current question is recomposition during handling the click button state. Better to keep handling using the Side-Effect mechanism: Side Effects. Also here the additional source to read about handling user interactions: User Interactions