# observeA2uiComponentState

## Functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/observeA2uiComponentState.composable#observeA2uiComponentState(androidx.a2ui.model.processor.A2uiSurfaceModel)(surface: https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiSurfaceModel)` Resolves the current `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` of the root component for an A2UI surface and subscribes for future updates. |
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentScope.https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/observeA2uiComponentState.composable#(androidx.a2ui.compose.runtime.A2uiComponentScope).observeA2uiComponentState(androidx.a2ui.compose.runtime.A2uiComponentReference)( reference: https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentReference )` Resolves the current `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` of a component by its `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentReference` and subscribes for future updates. |

## Functions

### observeA2uiComponentState

Artifact: [androidx.a2ui.compose:compose-runtime](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/runtime/A2uiComponentState.kt+function:observeA2uiComponentState) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui-compose#1.0.0-alpha02)

```
@Composable
fun observeA2uiComponentState(surface: A2uiSurfaceModel): A2uiComponentState
```

Resolves the current `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` of the root component for an A2UI surface and subscribes for future updates.

| Parameters |
|---|---|
| `surface: https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiSurfaceModel` | The `https://developer.android.com/reference/kotlin/androidx/a2ui/model/processor/A2uiSurfaceModel` containing the data, components, and catalog for this UI. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` | The reactive state of the root component. |

### A2uiComponentScope.observeA2uiComponentState

Artifact: [androidx.a2ui.compose:compose-runtime](https://developer.android.com/jetpack/androidx/releases/a2ui-compose) [View Source](https://cs.android.com/search?q=file:androidx/a2ui/compose/runtime/A2uiComponentScope.kt+function:observeA2uiComponentState) Added in [1.0.0-alpha02](https://developer.android.com/jetpack/androidx/releases/a2ui-compose#1.0.0-alpha02)

```
@Composable
fun A2uiComponentScope.observeA2uiComponentState(
    reference: A2uiComponentReference
): A2uiComponentState
```

Resolves the current `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` of a component by its `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentReference` and subscribes for future updates.

| Parameters |
|---|---|
| `reference: https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentReference` | The unique `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentReference` of the component to resolve. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` | The `https://developer.android.com/reference/kotlin/androidx/a2ui/compose/runtime/A2uiComponentState` of the requested component. |