Thread
#compose
    m

    molikto

    2 years ago
    @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
    Adam Powell

    Adam Powell

    2 years ago
    Please file it as a bug, b.android.com