Thread
#compose
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Why
    onCommit
    crashed with
    Composition re quires an active composition context
    ?
    @Composable
    fun NetworkImage(
    		modifier: Modifier,
    		url: String?,
    		placeholder: Int
    ) {
    		var image by remember { mutableStateOf<ImageBitmap?>(null) }
    
    		onCommit {
    				val picasso = Picasso.get()
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    onCommit has been deprecated for a number of releases now - which version of Compose are you using?
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Hmm… alpha12. And no warning about deprecated.
    Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    1 year ago
    Try using
    SideEffect
    instead - do you get the same error?
    onCommit was deprecated in alpha11 - idk why it’s not marked as such in the source.
    Yuri Drigin

    Yuri Drigin

    1 year ago
    Yep. You was right. For my case event better
    DisposableEffect