Joey Heck
08/03/2021, 8:42 PMval fileDialog = FileDialog(window.window)
fileDialog.isVisible = true
triggers Exception in thread "AWT-EventQueue-0" kotlinx.coroutines.CoroutinesInternalError: Fatal exception in coroutines machinery for CancellableContinuation(DispatchedContinuation[FlushCoroutineDispatcher@8e8a808, Continuation at androidx.compose.foundation.gestures.TapGestureDetectorKt.awaitChannelUpOrCancel(TapGestureDetector.kt:275)@45a19ee9]){Completed}@50fcdf16. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
//class field
val saveFileName = mutableStateOf(TextFieldValue())
TextField(
value = saveFileName.value,
onValueChange = { saveFileName.value = it },
)
olonho
08/04/2021, 5:55 AMIgor Demin
08/04/2021, 8:04 AMval saveFileName = remember { mutableStateOf(TextFieldValue()) }
Otherwise Compose will create a new state on every recompositionolonho
08/04/2021, 9:55 AMmutableStateOf
without remember
in composable function is an error. @alexey.tsvetkov maybe it's worth an IDE inspection?Joey Heck
08/04/2021, 2:44 PMIgor Demin
08/04/2021, 2:49 PMIf your mutableStateOf is inside class, not inside Composable function then indeed, remember isn't needed.
But the instance of class itself should be in remember too
Joey Heck
08/04/2021, 3:42 PM