When using `ComposeView` is it generally a bad pra...
# compose
j
When using
ComposeView
is it generally a bad practice to call
setContent
multiple times? My worry is that doing that will not trigger a recomposition (based on the existing content set in the previous
setContent
call) but rather a full composition from scratch.
1
a
both will work in general
🙏 1
a
It triggers a recomposition based on the previous state of the composition like any other mutableStateOf snapshot state change; ComposeView.setContent just sets a
mutableStateOf<@Composable () -> Unit>
to the function you pass it
If it's a different instance of the same function you'll get a pretty standard recomposition and probably a lot of skipping. If it's a different content function altogether then it will be composing as new content into the same composition
🙏 1