# ElementRefCallback

Callback invoked with the exact mounted DOM element.

## Signatures

```ts
export type ElementRefCallback<Element extends globalThis.Element> = (element: Element) => void | EffectInput | Stream.Stream<any, any, any> | Stream.Stream<any, never, never> | Fx<any, any, any> | Fx<any, never, never>;
```

## Why

A ref can initialize imperative web-standard APIs or return Effect, Stream,
or Fx work without replacing the node or hiding its identity.

## Ownership and lifetime

Returned Effect, Stream, or Fx work runs in the element's rendering Scope and
is interrupted when that Scope closes.
