I'm trying to diagnose why some composables are getting recomposed more often that I expect. Is there an easy way to diagnose what triggers the recompose using a tool like layout inspector?
f
Filip Wiesner
12/06/2023, 6:11 PM
Never tried it but you can check out Rebugger from @theapache64
Thanks for the suggestion. Unfortunately this is Compose multiplatform and rebugger isn't a drop in for common code.
Trey
12/06/2023, 8:29 PM
I moved my code to use the expect/actual pattern and I used Rebugger. Does having more than one thing change cause the recomposition to change the number of times as the things that changed? I posted a code snippet with my log output in the main channel. Rebugger confirmed that two things changing caused two recompositions of the function. I expected only one recomposition that changed both parameters at once.
z
Zach Klippenstein (he/him) [MOD]
12/07/2023, 3:42 PM
Your expectation is correct. Something else must be going on. Hard to say without seeing any code
👍 1
t
Trey
12/07/2023, 3:47 PM
I figured it out. I was updating a remembered variable that changed based on the flow. That was causing the extra recomposition. Thanks for all the help!