-
-
Save burnoo/3426fd05af195503b4b87da8311f49b1 to your computer and use it in GitHub Desktop.
Two-way data binding in Jetpack Compose 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun Screen() { | |
val viewModel = remember { ViewModel() } // or viewModel() etc. | |
val (password, setPassword) = viewModel.password.collectAsMutableState() | |
TextField( | |
value = password, | |
onValueChange = setPassword | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment