How can I pass the value to composable function fr...
# compose
How can I pass the value to composable function from non composable function(like from fragment) ?? I have to supply image object from registerForActivityResult to existing composable function every time when I pick the image from the gallery ? one way I made this bridge between composable and non composable is by introducing view model property , but it doesn’t look fair to me to define property in view model for every other UI entry point , I want to have common entry point where I can capture all user interaction of UI widget and then to make final call to remote , something like Bindable with BaseObserver with Android core api. I made this function by referring to example here - Now the challenge is , how can I update “mediaUploadInformation” from fragment registerForActivityResult ???
Copy code
fun rememberReviewFormState(
    title: TextFieldValue = TextFieldValue(""),
    comment: TextFieldValue = TextFieldValue(""),
    evaluationTotalScore: String? = "",
    mediaUploadInformation: Map<Uri, IMediaItem> = emptyMap(),
    postReviewTermsAccepted: Boolean = false
): ReviewFormUserData {

    return remember {
            title = title,
            comment = comment,
            evaluationTotalScore = evaluationTotalScore,
            mediaUploadInformation = mediaUploadInformation,
            postReviewTermsAccepted = postReviewTermsAccepted
Copy code
class ReviewFormUserData(
    title: TextFieldValue,
    comment: TextFieldValue,
    evaluationTotalScore: String?,
    mediaUploadInformation: Map<Uri, IMediaItem>,
    postReviewTermsAccepted: Boolean? = false
) {
    var title by mutableStateOf(title)
    var comment by mutableStateOf(comment)
    var evaluationTotalScore by mutableStateOf(evaluationTotalScore)
    var mediaUploadInformation by mutableStateOf(mediaUploadInformation)
    var postReviewTermsAccepted by mutableStateOf(postReviewTermsAccepted)