I'm trying to find out Om, and came across something that I do not understand. I would expect this code
(defn search-page-view [app owner]
(reify
om/IRender
(render [_]
(dom/div #js {:id "search-block"}
"Test")
(dom/div #js {:id "results-block"}
"Test2"))))
(om/root
search-page-view app-state
{:target (. js/document (getElementById "app"))})
to get this html:
<div id="app>
<div id="search-block">
Test
</div>
<div id="results-block">
Test2
</div>
</div>
However, it is not! The first test test is divnot displayed. What? I do not understand?
Edit using solution (indicated by FakeRainBrigand):
Change code to
(defn search-page-view [app owner]
(reify
om/IRender
(render [_]
(dom/div nil
(dom/div #js {:id "search-block"}
"Test")
(dom/div #js {:id "results-block"}
"Test2")))))
leads to the expected html.
source
share