Fork me on GitHub
#reagent
<
2016-11-25
>
danielgrosse03:11:46

If I build a hiccup vector with a for loop, what is the best practice to get unique keys?

danielgrosse06:11:33

Are there any projects which take markdown files and convert them into hiccup?

gadfly36106:11:11

@danielgrosse this may be relevant to you

gadfly36106:11:30

It doesnt take a file, but you could write a macro in clojure that slurps in a markdown file

juhoteperi06:11:08

But this is in Clojure so you can only use this on compile time with macros

danielgrosse06:11:00

I will try markdown-clj in combination with the SetInnerHtml

danielgrosse09:11:56

Wenn I set a reagent content with dangerousInnerHtml, how can I work with it after the generation? Do I have to use a DOM library?

credulous16:11:25

Hi. I’m doing something silly, but I can’t figure it out. I have a form that looks like this:

(let [account (r/atom {:country "US"})]

        [:div.column
         [:div.form-group
           [:label "Bank Country"]
           [:div.input-group
            [:select.form-control.custom-select
             {:value (:country @account)
              :on-change #(swap! account assoc :country (-> % .-target .-value))
              }
             [:option {:value "US"} "United States"]
             [:option {:value "AU"} "Australia"]
             [:option {:value "AT"} "Austria"]
             [:option {:value "BE"} "Belgium"]
             [:option {:value "CA"} "Canada"]
             [:option {:value "DK"} "Denmark"]
             [:option {:value "EE"} "Estonia"]
             [:option {:value "FI"} "Finland"]
             [:option {:value "FR"} "France"]
             [:option {:value "DE"} "Germany"]
             [:option {:value "GI"} "Gibralter"]
             [:option {:value "IT"} "Italy"]
             [:option {:value "IE"} "Ireland"]
             [:option {:value "LU"} "Luxembourg"]
             [:option {:value "NL"} "Netherlands"]
             [:option {:value "NO"} "Norway"]
             [:option {:value "PT"} "Portugal"]
             [:option {:value "ES"} "Spain"]
             [:option {:value "SE"} "Sweden"]
             [:option {:value "CH"} "Switzerland"]
             [:option {:value "GB"} "United Kingdom"]
             ]]]

        [:div.form-group ]

         [:button.btn.btn-primary.submitssnbutton
          {:disabled (if (ssn-valid? @user) nil true)
           :on-click #(process-bankinfo @user)}
          "Save Bank Information”]])
The form appears, but I can’t change the value of the select. Obviously a syntax problem but I’m stumped.

lsenta16:11:49

@credulous it looks like a form-1 component, you don’t miss an fn somewhere?

lsenta16:11:43

If your component is dynamic you want to return a function that is going to be called when the context (parameters, ratoms) change

credulous16:11:55

Cool, that’s probably it, thanks