Skip to main content

RenderHTMLSourceProps

export
interface RenderHTMLSourceProps {
  contentWidth?: number;
  onDocumentMetadataLoaded?: (documentMetadata: DocumentMetadata) => void;
  onHTMLLoaded?: (html: string) => void;
  onTTreeChange?: (ttree: TDocument) => void;
  source: HTMLSource;
}

Props for the ​RenderHTMLSource component.

Fields#

contentWidth#

optional
contentWidth?: number;

The width of the HTML content to display. The recommended practice is to pass useWindowDimensions().width minus any padding or margins.

Default: Dimensions.get('window').width

onDocumentMetadataLoaded#

optional
onDocumentMetadataLoaded?: (documentMetadata: DocumentMetadata) => void;

Handler invoked when the document metadata is available. It will re-trigger on HTML content changes.

onHTMLLoaded#

optional
onHTMLLoaded?: (html: string) => void;

Triggered when HTML is available to the RenderHTML component.

onTTreeChange#

optional
onTTreeChange?: (ttree: TDocument) => void;

Triggered when the transient render tree changes. Useful for debugging.

source#

required
source: HTMLSource;

The object source to render (either { uri }, { html } or { dom }).