Thread
#compose
    myanmarking

    myanmarking

    11 months ago
    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:
    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
    Albert Chang

    Albert Chang

    11 months ago
    You can create a custom state class similar to
    LazyListState
    ,
    BottomSheetState
    , etc.
    myanmarking

    myanmarking

    11 months ago
    ok. ill check. thanks