Fork me on GitHub
#reagent
<
2015-07-07
>
mikethompson05:07:52

Just to be clear, this code previously posted which produced an "arity 1" error ...

(defn navigation-component []
  [:div [:h1 "OpenSourceFinder"]])

(defn current-page []
  [:div [(session/get :current-page)]])

(defn layout-component []
  [:div [(navigation-component)]
        [(current-page)]])
is wrong because layout-component will return this hiccup ....
[:div [[:div [:h1 "OpenSourceFinder"]]
        [[:div [(session/get :current-page)]]]])
Take particular note of the hiccup which looks like this: [[something]] That hiccup will cause errors because of: https://github.com/Day8/re-frame/wiki/Using-%5B%5D-instead-of-%28%29#appendix-2

mikethompson05:07:51

It must be possible to turn the 1st element of a vector into a component

mikethompson05:07:27

This hiccup has the same problem:

[[:div "hello"]  [:div "there"]]

mikethompson05:07:13

because the first element of the vector (which is itself a vector) can't be used to create a component.

mikethompson05:07:47

@samueldev @coyotespike ^^^^ enquiring minds now know!

Petrus Theron12:07:14

I need to build some forms with reagent. What's the status quo? reagent-forms? re-com?

escherize12:07:21

[:form [:input {:type "text" :placeholder "hello"}]]

escherize12:07:27

is an option

samueldev13:07:45

@mikethompson: thank you very much for the explanation!

coyotespike15:07:24

@petrus I can't say what's the status quo - you have re-com, you have reforms (https://github.com/bilus/reforms), you have reagent-forms. I made my own buttons, etc., but personally I like the look of re-com and may switch.

coyotespike15:07:40

@mikethompson: thanks, that's good to know!

jwm15:07:51

seems like bootstrap gets more integration than foundation