---
title: "compositionContext"
description: "The [CompositionContext] that should be used as a parent for compositions at or below this view
in the hierarchy. Set to non-`null` to provide a [CompositionContext] for compositions created by
child views, or `null` to fall back to any [CompositionContext] provided by ancestor views.

See [findViewTreeCompositionContext]."
type: "property"
---

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


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

<div class='sourceset sourceset-android'>Android</div>


```kotlin
var View.compositionContext: CompositionContext?
```


The `CompositionContext` that should be used as a parent for compositions at or below this view
in the hierarchy. Set to non-`null` to provide a `CompositionContext` for compositions created by
child views, or `null` to fall back to any `CompositionContext` provided by ancestor views.

See `findViewTreeCompositionContext`.



