UNPKG

tinacms

Version:

[![GitHub license](https://img.shields.io/github/license/tinacms/tinacms?color=blue)](https://github.com/tinacms/tinacms/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/tinacms.svg?style=flat)](https://www.npmjs.com/package/tinacms) [![Bui

13 lines (12 loc) 611 B
/** * If the DOM wrapped by Tina contains an element with a * `data-tinafield` attribute matching `fieldName`, * `useFieldReference` will find it by querying the dom and return * the matched DOM element. * * `useFieldReference` is connected to a MutationObserver higher in the DOM, * and will cause components that use it to rerender any time content in the DOM * changes. This ensures reliable tracking of the referenced DOM element, but * may cause problems if `useFieldReference` is called in expensive renders. */ export declare const useFieldReference: (fieldName: string | null) => HTMLElement;