xetra11
11/25/2020, 8:21 PMList<String>
. However I'd like to manipulate that state from another @Composable
function (a popup dialog that opens). The values added in the popup should be added to the List<String>
of the mentioned table so the content is updated there immediatly.
I have a hard time grasping the concepts of state in Compose for Desktop. I am coming from a Vue.js background and I could not build the bridge regarding understanding the way to do that in Compose for Desktop.
Therefore I'd like to ask for some keywords I should look out for on Google. I already tried a lib called Decompose
but I do not fully understand it as it seems to only care about state within a component and not appwide (from my understanding)Arkadii Ivanov
11/25/2020, 8:36 PMArkadii Ivanov
11/25/2020, 8:52 PM@Composable
fun Counter() {
val state = remember { mutableStateOf(0) }
Button(onClick = { state.value += 1 }) {
Text(text = "Count: ${state.value}")
}
}
Same way you can define your List and add items there.xetra11
11/25/2020, 8:57 PMArkadii Ivanov
11/25/2020, 9:05 PMxetra11
11/25/2020, 9:07 PM