I’ll post this here, but maybe this is a question ...
# compose-desktop
a
I’ll post this here, but maybe this is a question about #compose in general 🤔 but I haven’t tested on Android yet I have an issue with a reference to local function inside composable, see
onValueChange = ::onValueChange
in attached code for example If I run this code and type “a” in first field, then type “b” in second field, the output shows “b” Then if I type “c”, the output shows “a.bc” If I change that line to use a lambda
onValueChange = { onValueChange(it) }
then output shows “a.b” as soon as I type “b” in above example Are local functions, or references, or references to local functions not supported in composables? Or this is some bug I found? Or I’m just doing something wrong?
z
Compose does something special with lambdas created inside composables. I’m guessing that that logic only works with lambdas and not function references, and that’s what’s messing up the state here. But I don’t remember enough of the details to be sure – @Leland Richardson [G] could speak to whether this is a bug or explicitly not supported.