https://kotlinlang.org logo
#compose
Title
# compose
y

Yasser AKBBACH

10/28/2023, 7:55 PM
Hello folks, is
navigation
considered as a
state
? in case that wasn't clear, there is an example: let's say we have a
state
:
Copy code
data class LoginState(
    val username: String,
    val password: String,
) {
    // We need nav controller to do the navigation
    fun navigateToDashboard()
}
would we consider
navigateToDashboard
as a state?
1
z

Zach Klippenstein (he/him) [MOD]

10/29/2023, 5:13 PM
Navigation is absolutely state. Navigation events aren’t state, events and state are different
🤔 1
y

Yasser AKBBACH

10/29/2023, 6:19 PM
Well, does it mean we can pass
nav controller
to
state
and handle the event there?
2 Views