json-dom
    Preparing search index...

    Function renderHtml

    • This is a shortcut for syncing a Virtual DOM (DomItem tree) item onto the real HTML DOM: builds the real elements for it and its descendants, inserts them into parent's children (the document body by default), and binds their associated listeners.

      Parameters

      • item: DomItem | null = null

        The DomItem that we want to render the element for

      • parent: DomItem = documentItem.body

        Where to insert item, when it does not already have a parent - defaults to the document body, so passing nothing keeps working exactly as before

      • index: number = parent.children.length

        Where in parent's children to put item - defaults to the end (a plain append), so passing nothing keeps working exactly as before. To insert item among parent's already-rendered content (existing real HTML), parent's children must already reflect that content first - see updateDomItems, which captures the real DOM into items. Skipping that step and inserting anyway will make the next render remove the untracked content, since it is invisible to parent.children.

      Returns DomItem