https://kotlinlang.org logo
#compose
Title
# compose
a

adjpd

01/30/2022, 7:38 PM
Is there a way to check which
Composable
is needlessly being recomposed? I want to see if a
Text
is recomposed for example.
s

Stylianos Gakis

01/31/2022, 2:18 AM
SideEffect
runs on every recomposition, you can add a log statement in there and have it in the composition scope that you want to check
🙌 1
j

jasu

01/31/2022, 7:07 AM
Oh nice trick, @Stylianos Gakis thanks
👍 1
c

Colton Idle

02/06/2022, 9:01 PM
Why even bother putting a log in a sideEffect? Just put it in the composable?
s

Stylianos Gakis

02/06/2022, 9:19 PM
The log would potentially happen more than necessary, in case of for example a dropped recomposition. It's probably most of the time not gonna matter but I'd say it's "more correct" to do it inside a SideEffect
today i learned 1