Why for recomposing, we must use an event like onClick from a Button?
for example, my code is:
if (movieSearchinfo.movieorserie == "serie") {
val serie1 = remember { mutableStateOf(false) }
if (serie1.value == true) {
Column(
modifier = Modifier
.verticalScroll(
rememberScrollState()
)
.height(100.dp)
) {
LazyColumn(
modifier = Modifier
.padding(4.dp)
) {
items(movieDetail.value) { movieDetail ->
if (movieDetail.se == "1") {
serie1.value = true
GetSerieCard(
Modifier,
movieDetail
)
}
}
}
}
when after my last if, I say: serie1.value = true, why jetpack doesn't recompose and doesn't make the UI of my first if? because the serie1.value became true now?
I saw somewhere that we can use:
currentComposer.composition.recompose()
but I don't know what he meant. does anyone know how we can use it? I used it somehow but it didn't work. maybe I used it wrong