Hi folks,
can any one tell me what’s the difference between state and memo wrt to compose?
z
Zsolt
01/10/2020, 9:26 AM
naked value = changes to it are lost on recompose, gets reinitialised the next time
memo = survives recomposition
state = memo + also triggers recompose when changed
👌 2
👍 2
k
karandeep singh
01/10/2020, 9:30 AM
so memo is sort of global variable?
z
Zsolt
01/10/2020, 9:32 AM
no, it's still local to the level where you defined it, and will be released when that composable gets destroyed for good
i
Ian Warwick
01/10/2020, 10:04 AM
Thanks Zsolt! good to know 👍
k
karandeep singh
01/10/2020, 10:18 AM
does changing state inside compose function calls that function?