Fork me on GitHub
#re-frame
<
2016-03-31
>
alex-eberts02:03:36

Hi folks - doesn’t anyone know how to set a re-com component’s html id value? I have tried the following but I’m receiving a TypeError:

alex-eberts02:03:48

(fn []
      [:input-text
       :attr {:id "foo"}
       :model text-val
       :on-change #(dispatch [:foo-handler @text-val])]) ))

alex-eberts02:03:56

sorry, should be:

(defn inputfoo []
  (let [text-val (reagent/atom "")]
    (fn []
      [:input-text
       :attr {:id "foo"}
       :model text-val
       :on-change #(dispatch [:foo-handler @text-val])]) ))

gregg02:03:08

You have :input-text (keyword) as the component name. Should probably be input-text or re-com/input-text

alex-eberts02:03:19

Thanks @gregg! silly error - I’ve been staring at this too long 😅

gregg02:03:43

np, I do that all the time 😉

gregg02:03:24

well not that one exactly, my favourite one is not derefing my atoms

alex-eberts02:03:12

lol - yup! done that one a few time 😉

slotkenov08:03:33

Hey, I’m getting an uncaught ISeqable exception in router.cljs, not sure why though

slotkenov09:03:12

Adding a LazySeq to my ‘db’ seems to trigger this Exception