Is there any recommended practice to expose some c...
# compose
m
Is there any recommended practice to expose some composable internal state, but keeping it updatable only internally? For instance, i have this inside the composable:
Copy code
val hasError by remember(textFieldValue.value) {
    derivedStateOf {
        textFieldValue.value.text.isNotEmpty() && isInputValid(textFieldValue.value.text).not()
    }
}
I want the caller code to access this value, but i don’t want to change it outside
a
You can create a custom state class similar to
LazyListState
,
BottomSheetState
, etc.
m
ok. ill check. thanks