This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-21
Channels
- # admin-announcements (2)
- # beginners (22)
- # boot (223)
- # cider (161)
- # cljs-dev (19)
- # cljsrn (4)
- # clojure (186)
- # clojure-austin (6)
- # clojure-beijing (1)
- # clojure-boston (3)
- # clojure-china (1)
- # clojure-czech (1)
- # clojure-france (1)
- # clojure-greece (10)
- # clojure-russia (17)
- # clojure-uk (154)
- # clojurebridge (3)
- # clojurescript (82)
- # component (12)
- # cursive (12)
- # datomic (71)
- # dirac (3)
- # editors (2)
- # emacs (29)
- # flambo (31)
- # hoplon (21)
- # immutant (11)
- # instaparse (17)
- # jobs (2)
- # jobs-discuss (2)
- # jobs-rus (1)
- # lein-figwheel (12)
- # leiningen (2)
- # off-topic (44)
- # om (78)
- # onyx (38)
- # parinfer (1)
- # re-frame (34)
- # reagent (32)
- # spacemacs (56)
- # untangled (74)
- # vim (12)
- # yada (2)
Hey, so I'm used to using react-router and am trying to setup a similar routes config with reagent. Wondering if anyone can point me in the direction of how to nest routes that link to components that will then be composed? Or is this even supported?
by the way; if anyone’s using reagent with bootstrap; we built some stuff to scratch our own itches: https://www.github.com/racksec/wilson
I'm encountering an issue using reagent and secretary where the url will change but nothing in the dom will change?!? has anyone encountered this before?
(defroute "/client/:id/book" [id]
(let [
current-dossier (utils/get_contact_by_id id app-state)
client-profile (:profile current-dossier)
]
(swap! app-state assoc :page :book)
(swap! app-state assoc :current-client client-profile)
)
)
does it vary significantly from this: https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/add-routing
(defmulti current-page #(@app-state :page))
(defmethod current-page :book []
(let [local_data (r/atom {:step :step1 :booking-flow {:selected-date (js/moment)}})]
(fn []
[pk-booking/book local_data app-state]
)
)
)
(defmethod current-page :default []
(swap! app-state assoc :modal-type :appointment-option)
[base-view app-state
[:div "What were you looking for?"]]
)
hmm i just realized i no longer embed app-state in current-page. that recipe is old, have a look at this: https://github.com/gadfly361/reagent-figwheel/blob/master/src/leiningen/new/reagent_figwheel/src/cljs/core_routes.cljs instead
yes, be cautions about multimethods http://stackoverflow.com/a/33487691
interesting! because that component is the only one not following the other "template" structure I've setup...
@mikethompson: it worked! Thanks! Thank you @gadfly361
Does anyone know if reagent will do self-closing tags on iframe
elements? If so, is there a way to switch that off to force actual closing tags?
i tried to convert a component to the style using create-class
and it doesn’t show up now. I
have googled around for 45 mins or so and can’t figure out what I am doing wrong, can anyone see a problem with this code?
(defn item
[i]
(reagent/create-class
{:component-did-mount #(println "foo")
:reagent-render
(fn [i]
[:div.item {:class (item-class i)}]
[:div.attr (:retailer_name i)]]
)}))
do you have to use that differently than a component that just is the hiccup part? before I just used it as (item i), is there some other constructor to use with this way or something?
Isn't there a syntax error in that renderer?
yeah, ignore it though, i just messed it up when eliding some lines for pasting
Well, it looks fine to me. So the issue must be elsewhere