# Composite.activeDescendant

Derives activeId only under virtual focus, otherwise undefined.

## Signatures

```ts
export declare function activeDescendant<CompositeState extends State, E, R>(state: RefSubject.RefSubject<CompositeState, E, R>): RefSubject.Computed<string | undefined, E, R>;
```

## Why

The operation exposes Composite's transition directly so callers can compose it in Effect
programs and native event handlers.

## Ownership and lifetime

Creating the Computed value acquires nothing eagerly. The Scope that subscribes to it owns
observation of the source RefSubject.

## Example

Import with `import { activeDescendant } from "@typed/ui/Composite";` Extend the
[Composite.makeState runnable setup](https://tylors.github.io/typed-smol/reference/symbols/QHR5cGVkL3VpL0NvbXBvc2l0ZSNtYWtlU3RhdGU/). Inside
the linked Effect program read `const id = yield* activeDescendant(state)`; it is the active id
only under virtual focus and otherwise `undefined`.
