---
title: "rememberCompositionContext"
description: "An Effect to construct a [CompositionContext] at the current point of composition. This can be
used to run a separate composition in the context of the current one, preserving
[CompositionLocal]s and propagating invalidations. When this call leaves the composition, the
context is invalidated."
type: "composable"
---

<div class='type'>Composable Function</div>


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

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


```kotlin
@Composable
public fun rememberCompositionContext(): CompositionContext
```


An Effect to construct a `CompositionContext` at the current point of composition. This can be
used to run a separate composition in the context of the current one, preserving
`CompositionLocal`s and propagating invalidations. When this call leaves the composition, the
context is invalidated.




