---
title: "CompositionContext"
description: "A [CompositionContext] is an opaque type that is used to logically \"link\" two compositions
together. The [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 [CompositionLocal]s flow
logically through the two compositions as if they were not separate.

The \"parent\" of a root composition is a [Recomposer]."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
public abstract class CompositionContext internal constructor()
```


A `CompositionContext` is an opaque type that is used to logically "link" two compositions
together. The `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 `CompositionLocal`s flow
logically through the two compositions as if they were not separate.

The "parent" of a root composition is a `Recomposer`.


## Functions

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


