I'm playing around with Jetpack Compose and I think I have a side effect in my composable, which tries to send an error report when it finds an unexpected value.
For example:
@Composable
fun SampleComposable(state: State, text: String) {
when (state) {
value1 -> {
// show composable
}
value2 -> {
// show composable
}
else -> {
// send an error report
}
}
Text(text)
}
So I believe whenever state or text changes, this will recompose. If state is an unexpected value, and text changes, it will send another error report. So I think there's a side effect in the else block.
Is there a way I should be structuring this code so that an error report isn't sent every time?