Why `onCommit` crashed with `Composition re quires...
# compose
y
Why
onCommit
crashed with
Composition re quires an active composition context
?
Copy code
@Composable
fun NetworkImage(
		modifier: Modifier,
		url: String?,
		placeholder: Int
) {
		var image by remember { mutableStateOf<ImageBitmap?>(null) }

		onCommit {
				val picasso = Picasso.get()
z
onCommit has been deprecated for a number of releases now - which version of Compose are you using?
y
Hmm… alpha12. And no warning about deprecated.
z
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.
y
Yep. You was right. For my case event better
Copy code
DisposableEffect