This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-13
Channels
- # admin-announcements (17)
- # aleph (1)
- # arachne (2)
- # boot (152)
- # braveandtrue (8)
- # cljs-dev (12)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (105)
- # clojure-austin (1)
- # clojure-belgium (5)
- # clojure-berlin (1)
- # clojure-brasil (5)
- # clojure-canada (2)
- # clojure-dev (6)
- # clojure-gamedev (1)
- # clojure-greece (9)
- # clojure-russia (39)
- # clojure-uk (9)
- # clojurescript (106)
- # component (4)
- # cursive (1)
- # data-science (3)
- # datascript (1)
- # datomic (9)
- # emacs (6)
- # hoplon (92)
- # jobs (1)
- # ldnproclodo (2)
- # lein-figwheel (1)
- # off-topic (19)
- # om (47)
- # om-next (1)
- # onyx (10)
- # other-languages (1)
- # proton (1)
- # re-frame (5)
- # reagent (36)
- # rethinkdb (1)
- # ring (2)
- # rum (1)
- # yada (14)
@madvas: it works for you? can you show me the code with the full react lifecycle using i.E. :component-did-mount
and renders more material ui components inside? much appreciated, thanks
this text: encoded <script>alert(1);<script> is rendered fine by react https://jsfiddle.net/pufhzme5/
but not by reagent http://cljsfiddle.com/#gist=1d66d8b98e0d0f5c09b7c1d8eec5d97e
The thing is @rohit that I load the values escaped from the database, in that form: encoded <script>alert(1);<script>
@danbunea: you can use the dangerouslySetInnerHTML
hack. See this: https://github.com/reagent-project/reagent/issues/14
More discussion about it here: https://facebook.github.io/react/docs/jsx-gotchas.html
@danbunea: this works for me: [:h1 {:dangerouslySetInnerHTML {:__html "encoded <script>alert(1);<script>"}}]
The (prn 'new new-props)
just prints 'new nil
@martinklepsch: just a guess, have you tried, (reagent/children comp)
[selection-tether :a :b]
@rohit: children indeed returns what I'd expect
@martinklepsch: to me it makes sense that the props
are nil. i don’t see any being passed. children
should be [:a :b]
.
@rohit: I'm confused, how would I pass it correctly?
@martinklepsch: i think props have to be passed when you are calling the selection-tether
. also it has to be a map. so something like [selection-tether {…} :a :b]
.
also I think you’ll have to store the previous/current data in an atom itself. i’m not sure how to use React to get the previous value
did update gets prevProps
& prevState
so should be ok without an extra atom
void componentDidUpdate(
object prevProps, object prevState
)
@martinklepsch: oh nice. i didn’t realise that.
Curious if anyone can address this question: I asked it in the #C06DT2YSY channel, and the answer was fairly unsatisfactory: Can components built from Reagent be used in a React JS project?
It presupposes other problems like including a compiled Clojurescript library in a JS project, but assuming that’s worked out, could a React component render the results of a Reagent component?
@kendall.buchanan: yes, although i have never tried it myself - https://github.com/reagent-project/reagent/blob/master/src/reagent/core.cljs#L56
Sweet! Thank you, @mccraigmccraig.