@mocanvas/mocanvas · function

readText

declare function readText(props: unknown, key?: string): string

A shape's label as plain text.

A label has two spellings on the record — props.richText, the document the store keeps, and props.text, its flattened form — and this reconciles them through readRichText so the two readers can never disagree about what a shape says.

key names a *plain-text-only* prop (a frame's name); only the default "text" participates in the reconciliation, because only it has a rich counterpart.

Mentioned here

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.