# ReadOnlyComposable

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/ReadOnlyComposable.kt+class:androidx.compose.runtime.ReadOnlyComposable) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.0.0) Common/AllAndroid/JVMNative/C/iOSJavaScript
- Cmn

  ```
  @MustBeDocumented
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER])
  annotation ReadOnlyComposable
  ```

*** ** * ** ***

This annotation can be applied to `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable` functions so that no group will be generated around the body of the function it annotates. This is not safe unless the body of the function and any functions that it calls only executes "read" operations on the passed in composer. This will result in slightly more efficient code.

A common use case for this are for functions that only need to be composable in order to read `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal` values, but don't call any other composables.

Caution: Use of this annotation means that the annotated declaration *MUST* comply with this contract, or else the resulting code's behavior will be undefined.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ReadOnlyComposable#ReadOnlyComposable()()` | Cmn |

## Public constructors

### ReadOnlyComposable

Cmn

```
ReadOnlyComposable()
```