helix 2023-09-13

if i defnc a component, how can i loop over a vector of items to use that component and put them inside a div? for is lazy. so maybe mapv ? or do i have to write ~@ macro like the todomvc example?

You can wrap for in β€˜doall’

πŸ™ 2

lazy seqs are fine to use in helix components

πŸ™ 1

I am confused by this example

(#($ Sentence %) (first mock-data))
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:children {:content "this is 1"}}, :_owner nil, :_store #js {}}
($ Sentence (first mock-data))
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:children {:content "this is 1"}}, :_owner nil, :_store #js {}}
(first mock-data)
;; => {:content "this is 1"}


($ Sentence {:content "this is 1"})
;; => #js {"$$typeof" "Symbol(react.element)", :type #object[dudee$core$Sentence_render], :key nil, :ref nil, :props #js {:content "this is 1"}, :_owner nil, :_store #js {}}
The result of (first mock-data) should imply ($ Sentence (first mock-data)) and ($ Sentence {:content "this is 1"}) are the same, but the result is different! Did I miss anything?