[]previous and next page

TextChild

Children of elements whose content is text only: textarea, option, script, style.

Children of elements whose content is text only: textarea, option, script, style. Accessors are allowed because the runtime inserts text nodes reactively.

Import#

ts
import type { TextChild } from "@shadow-js/web";

Signature#

ts
type TextChild =
  | string
  | number
  | null
  | undefined
  | (() => string | number | null | undefined)

Examples#

ts
import { useSignal } from "@shadow-js/core";
import type { TextChild } from "@shadow-js/web";

const [draft] = useSignal("Hello");
const content: TextChild = draft;
const editor = <textarea>{content}</textarea>;