(elem *vdom.VDomElem, comp **ComponentImpl, containingComp string, opts *RenderOpts)
| 37 | } |
| 38 | |
| 39 | func (r *RootElem) render(elem *vdom.VDomElem, comp **ComponentImpl, containingComp string, opts *RenderOpts) { |
| 40 | if elem == nil || elem.Tag == "" { |
| 41 | r.unmount(comp) |
| 42 | return |
| 43 | } |
| 44 | elemKey := getElemKey(elem) |
| 45 | if *comp == nil || !(*comp).compMatch(elem.Tag, elemKey) { |
| 46 | r.unmount(comp) |
| 47 | r.createComp(elem.Tag, elemKey, containingComp, comp) |
| 48 | } |
| 49 | (*comp).Elem = elem |
| 50 | if elem.Tag == vdom.TextTag { |
| 51 | // Pattern 1: Text Nodes |
| 52 | r.renderText(elem.Text, comp) |
| 53 | return |
| 54 | } |
| 55 | if isBaseTag(elem.Tag) { |
| 56 | // Pattern 2: Base elements |
| 57 | r.renderSimple(elem, comp, containingComp, opts) |
| 58 | return |
| 59 | } |
| 60 | cfunc := r.CFuncs[elem.Tag] |
| 61 | if cfunc == nil { |
| 62 | text := fmt.Sprintf("<%s>", elem.Tag) |
| 63 | r.renderText(text, comp) |
| 64 | return |
| 65 | } |
| 66 | // Pattern 3: components |
| 67 | r.renderComponent(cfunc, elem, comp, opts) |
| 68 | } |
| 69 | |
| 70 | // Pattern 1 |
| 71 | func (r *RootElem) renderText(text string, comp **ComponentImpl) { |
no test coverage detected