# CompositionContext

Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/CompositionContext.kt+class:androidx.compose.runtime.CompositionContext) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.0.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  abstract class CompositionContext
  ```
Known direct subclasses [Recomposer](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Recomposer)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Recomposer` | The scheduler for performing recomposition and applying updates to one or more `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composition`s. |

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext` is an opaque type that is used to logically "link" two compositions together. The `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext` instance represents a reference to the "parent" composition in a specific position of that composition's tree, and the instance can then be given to a new "child" composition. This reference ensures that invalidations and `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal`s flow logically through the two compositions as if they were not separate.

The "parent" of a root composition is a `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Recomposer`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/rememberCompositionContext.composable#rememberCompositionContext()` |   |

## Summary

| ### Public functions |
|---|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/runtime/CancellationHandle` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext#scheduleFrameEndCallback(kotlin.Function0)(action: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` | Cmn |

| ### Public properties |
|---|---|---|
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionContext#effectCoroutineContext()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` with which effects for the composition will be executed in. | Cmn |

## Public functions

### scheduleFrameEndCallback

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.10.0)

```
abstract fun scheduleFrameEndCallback(action: () -> Unit): CancellationHandle
```

## Public properties

### effectCoroutineContext

Cmn Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.5.0)

```
abstract val effectCoroutineContext: CoroutineContext
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` with which effects for the composition will be executed in.