I've Boolean variable in child composable which I ...
# compose
r
I've Boolean variable in child composable which I want to reassign from parent composable. How do I do that? Tried state hoisting but that didn't worked.
z
Generally speaking, something outside of a function can’t re-assign variables defined inside that function. If the variable represents some state that the parents needs to control, state hoisting is the generally-recommended solution. Can you elaborate on what you tried and how it didn’t work? Code would be helpful.
r
Ok I removed that variable as it does not required anymore. But I had one Boolean called
doNotShowRationale
(as in permission dialog) in child composable and I wanted to change it to true from parent composable. But ya, as you said, something outside function can't re-assign.