Hello 👋 Can you please confirm if the following assertion is true ?
Given : a tree of composables
Copy code
+ Parent // retrieves state from ViewModel, declares fun action on VM
|
|---+ Child A // passes state without using it, passes action as fun
|
|---+ Child A-1 // uses state
|
|---+ Child A-2
|
|---+ Child A-3 // invoke the action fun
When : invoking the passed action by clicking on Child A-3Then :
Copy code
+ Parent // will NOT recompose
|
|---+ Child A // will recompose (because A-1 recompose)
|
|---+ Child A-1 // will recompose
|
|---+ Child A-2 // will NOT recompose
|
|---+ Child A-3 // will NOT recompose
s
Siyamed
10/30/2020, 8:59 PM
repaint --> recompose?
✔️ 1
o
Oussama Haff.
10/30/2020, 9:01 PM
yes (sorry I’m still using legacy android view terms 😅)
k
Kshitij Patil
10/31/2020, 4:17 AM
Is it possible to call
recompose
programmatically? If so, then you can call the same in Child-3 or change the stage Child-A1 using and I think Child A and A-1 will recompose as you're expecting
o
Oussama Haff.
10/31/2020, 5:09 AM
@Kshitij Patil I didn’t really catch your idea, but what I’m sharing is the behaviour of Compose that I have observed.
I want just to make sure that my observation is correct.
k
Kshitij Patil
10/31/2020, 5:16 AM
Forget what I said about recomposing, I just believe that your assertion will work