I have this simple IconButton, but when i try to inspect the recomposition the number goes up when scrolling on LazyColumn, whereas the IconButton is unaffected. I've tried to pass empty lambda on the onClick
, no recomposition happened though.
IconButton(
onClick = onBackArrowClick,
content = {
Icon(
imageVector = Icons.Default.ArrowBack,
contentDescription = null,
),
}
)
Well, it obviously looks like something is happening with your onBackArrowClick
labmda that's causing it to recompose. Try passing a non-variable labmda, and see what happens. Something like:
onClick = { Log.d("***", "OnClick triggered") }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.