Hello! I'm using Canvas and noticed that onDraw la...
# compose
p
Hello! I'm using Canvas and noticed that onDraw lambda invokes more frequently than expected. Even if other composables recomposes not related with this Canvas. So when using it when drawing complex logic it cause UI hanging for seconds. What is the best practice for decreasing unnecessary redrawing?
m
probably, those unrelated composables are at the same level, so your canvas composable recomposes as well. Without having the full code is difficult to spot the issue. But based on what you told me, other composables recompose are making the canvas to recompose as well, because other composables state is read at the same level