(render comp container)
(render comp container callback)
Render a Reagent component into the DOM. The first argument may be
either a vector (using Reagent's Hiccup syntax), or a React element. The second argument should be a DOM node.
Optionally takes a callback that is called when the component is in place.
Returns the mounted component instance.
Source
(defn
render
"Render a Reagent component into the DOM. The first argument may be\n either a vector (using Reagent's Hiccup syntax), or a React element. The second argument should be a DOM node.\n\n Optionally takes a callback that is called when the component is in place.\n\n Returns the mounted component instance."
([comp container] (render comp container nil))
([comp container callback]
(ratom/flush!)
(let
[f (fn [] (tmpl/as-element (if (fn? comp) (comp) comp)))]
(render-comp f container callback))))