dkim
02/13/2022, 1:58 PMAlexander Maryanovsky
02/13/2022, 4:59 PMremember { mutableStateOf(…) }
to store a State in a composition.Alexander Maryanovsky
02/13/2022, 5:00 PMdkim
02/13/2022, 5:00 PMval variable = remember { mutableStateOf(false) }
variable.value = !variable.value
but that didn't work 😕dkim
02/13/2022, 11:26 PMdkim
02/13/2022, 11:26 PMmcpiroman
02/14/2022, 7:07 PMmcpiroman
02/14/2022, 7:08 PMdkim
02/14/2022, 8:29 PMmcpiroman
02/15/2022, 10:49 AMZach Klippenstein (he/him) [MOD]
02/16/2022, 1:48 PMmain
function). However, in the code sample you posted, it looks like update
is a verb, and state is nouns not verbs. It sounds like you might want to store the color in a mutable state and then update that color when a key press happens. Then any composables reading that color will automatically update on the next frame.