I have a weird issue where `Test` composable in th...
# compose
d
I have a weird issue where
Test
composable in the snippet is not recomposed on state change, it's only called once. This seems to happen only if this Box is placed inside a
sheetContent
of
BottomSheetScaffold
:
Copy code
Box {
  var enable by remember { mutableStateOf(true) }
  println("enable out=$enable")
  Test(enable = enable)
  Button(onClick = { enable = !enable })
}

@Composable
fun Test(enable: Boolean) {
  println("enable in=$enable")
  Text(text = enable.toString())
}
šŸ¤” 1
Whenever I press the button, outer
println
is called, but iner println is not called, it appears only once
Any ideas on how to debug this?
a
If you can come up with a repro, file a bug.
d
Yep, I will try, something really weird. This happens only if
enable
is boolean. I thought maybe boxing is involved, but it works for
Int
,
String
, whatever else. Only
boolean
causes no further calls to
Test()
to occur.
a
Youā€™d better file with the specific component (ā€œJetpack Composeā€ or ā€œJetpack Compose > Compiler plug-in and runtimeā€ in this case) instead of the general ā€œApp Developmentā€ in order for the right people to see it.
d
Ooops, I thought I filed it under Jetpack Compose, not sure how it ended up in a more generic one. And I don't know how to move it šŸ˜ž UPD: looks like I have no permissions to edit, recreated as https://issuetracker.google.com/issues/207227862