---
title: "withRunningRecomposer"
description: "Runs [block] with a new, active [Recomposer] applying changes in the calling [CoroutineContext].
The [Recomposer] will be [closed][Recomposer.close] after [block] returns.
[withRunningRecomposer] will return once the [Recomposer] is [Recomposer.State.ShutDown] and all
child jobs launched by [block] have [joined][Job.join]."
type: "function"
---

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


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
public suspend fun <R> withRunningRecomposer(
    block: suspend CoroutineScope.(recomposer: Recomposer) -> R
): R
```


Runs `block` with a new, active `Recomposer` applying changes in the calling `CoroutineContext`.
The `Recomposer` will be `closed` after `block` returns.
`withRunningRecomposer` will return once the `Recomposer` is `Recomposer.State.ShutDown` and all
child jobs launched by `block` have `joined`.



