This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-11
Channels
- # bangalore-clj (1)
- # beginners (24)
- # boot (134)
- # boulder-clojurians (2)
- # cider (3)
- # cljs-dev (2)
- # cljsjs (44)
- # clojars (9)
- # clojure (60)
- # clojure-greece (2)
- # clojure-quebec (1)
- # clojure-russia (44)
- # clojure-spec (15)
- # clojure-uk (1)
- # clojurescript (37)
- # core-matrix (1)
- # datomic (7)
- # emacs (1)
- # hoplon (154)
- # liberator (3)
- # mount (2)
- # om (20)
- # onyx (2)
- # pedestal (3)
- # planck (12)
- # re-frame (26)
- # reagent (32)
- # uncomplicate (4)
I am trying to use
with my re-frame app. I could not find it in
. So, could anyone help me on how to use it in my app?
what is the blessed way of dealing with dynamic classes in components? like active
or selected
? plain conditional does not seem to scale well...
How do I render HTML as HTML and not as escaped in Hiccup? Developing an app with Reagent.
@artur see dan's first comment for an example: https://github.com/reagent-project/reagent/issues/14
Great, thanks @gadfly361
Disclaimer — Reagent newbie here! How do i decorate a reagent component? I mean, how one can access props of component which is passed as a parameter to function? Here’s some code that illustrates the idea:
(defn comp []
[:div "im test comp"])
(defn decorate [comp]
;; access comp props and state here?
comp)
;; markup:
...
[(decorate comp)]
...
@olegakbarov in your markup there are no props supplied ... so I'm left wondering how you would imagine that happening
hmm, how about this:
(defn comp [name]
[:div "im test comp with name:” name])
(defn decorate [comp]
;; access comp props and state here?
comp)
;; markup:
...
[(decorate comp “name")]
(defn comp
[name]
[:div "im test comp with name:" name])
(defn decorate
[comp & props]
(into [comp] props)) ;; <---- will produce [comp "name"]
;; markup:
[decorate comp "name"] ;; <---- I took out the ()
aha! what about access to state and lifecycle hooks?
You'll have to be more specific
We don't tend to use React's .state
in Reagent
okay, thank you! i need to play a round a little more with code to come back with more specific questions
It sounds like you have a React background
And you are looking for the Reagent analogs
yes correct, i’ve built a couple apps with React/Redux and now wrapping my head around Reagent and CloujureScript as a whole
If you have used Redux, then you will want to look at re-frame
(Warning: I'm the author)
i already use it!
awesome job
There is a #re-frame channel
For those kind of questions ... although obviously your questions above are very appropriate for this channel
actually my question derives 😉 from the problem i have with ClojureScript
i’m looking for idiomatic way to do drag-and-drop
Well, Reagent does mess with your understanding of function calls when you first start 🙂
Make sure you read the pages under "Reagent Tutorials" in here https://github.com/Day8/re-frame/wiki (You probably have, but just in case)
yea, i’ve read it and pretty sure i’ll come back for more
now i’m thinking about ways of porting (or rewriting) http://gaearon.github.io/react-dnd/ in clojure
and thus DnD relies heavily on HoC, i wanted to explore this topic in Clojure
i’m a little surprised nobody have explored this stuff in ClojureScript community
too bad i’m such a newb to port it fast!
all ideas are welcome btw!