type-alias / @typed/ui/Dom/Types

ElementRef

Optional ref contract shared by DOM-backed component options.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Element ref types
Since
1.0.0

Import

import { ElementRef } from "@typed/ui/Dom/Types";

Signatures

export type ElementRef<Element extends globalThis.Element> = {
    readonly ref?: ElementRefCallback<Element> | RefSubject.HydrationRef<any, any>;
};

Why

It supports both ordinary element callbacks and a RefSubject hydration owner at the same host boundary.

Ownership and lifetime

A mounted element may have only one hydration owner. Composed ordinary refs share the rendering Scope and must not outlive the element.

Property: ref

The callback or sole hydration owner for the mounted element.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source