https://kotlinlang.org logo
#compose
Title
# compose
m

molikto

02/12/2020, 2:43 PM
Copy code
@Composable fun Outer(i: Int, onClick: () -> Unit) {
        @Composable fun Capturing() {
            Text(i.toString())
        }
        Capturing()
        Button(onClick = onClick) {
            Text("me " + i)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            Column {
                var i by state { 0 }
                Outer(i, {
                    i += 1
                })
            }
        }
it seems nested functions can be defined but they are not working properly,
Capturing
is considered not depending on any parameters, so it will not update when recompose
👌 2
a

Adam Powell

02/12/2020, 2:45 PM
Please file it as a bug, b.android.com
7 Views