This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-15
Channels
- # arachne (6)
- # aws-lambda (3)
- # beginners (14)
- # boot (56)
- # cider (8)
- # cljs-dev (5)
- # cljsrn (11)
- # clojure (240)
- # clojure-dusseldorf (3)
- # clojure-greece (165)
- # clojure-italy (5)
- # clojure-romania (1)
- # clojure-russia (24)
- # clojure-uk (30)
- # clojure-ukraine (3)
- # clojurescript (29)
- # core-async (6)
- # css (1)
- # cursive (25)
- # datascript (6)
- # datomic (61)
- # dirac (1)
- # events (3)
- # hoplon (1)
- # instaparse (3)
- # jobs (4)
- # juxt (28)
- # lein-figwheel (7)
- # leiningen (19)
- # luminus (1)
- # lumo (2)
- # nyc (1)
- # off-topic (19)
- # om (25)
- # onyx (4)
- # parinfer (2)
- # pedestal (23)
- # perun (20)
- # re-frame (44)
- # reagent (20)
- # remote-jobs (3)
- # ring (3)
- # ring-swagger (5)
- # rum (12)
- # slack-help (3)
- # spacemacs (25)
- # specter (62)
- # sql (16)
- # unrepl (313)
- # yada (4)
How do you inherit js-props passed into a reagent component?
Ah never mind. It turns out I needed access to “context” (whatever that is). This seems like kind of a hack, so someone please tell me if there’s a more elegant way to do this.
(this-as this
(let [showActionSheetWithOptions (aget this ["_reactInternalInstance" "_context" “showActionSheetWithOptions”)]
@seantempesta if you're trying to access React props on a component, there's reagent.core/props
http://blog.ducky.io/reagent-docs/0.6.0-alpha2/reagent.core.html#var-props
hello. I have an issue probably related to cljs/react-dom
. I added these deps to project.clj:
[reagent "0.6.1" :exclusions [cljsjs/react]]
[cljsjs/react-with-addons "15.4.2-2"]
And this code doesn’t work:`
[css-transition-group {:transitionName "example" :transitionEnterTimeout 500 :transitionLeaveTimeout 500}
(if (<sub [:move "balsero"])
^{:key "whatever"} [:p "balsero"])]
The error I get is TypeError: Cannot read property 'findDOMNode' of null
, occurs here:
transition: function (animationType, finishCallback, userSpecifiedDelay) {
var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
Do I need to add or exclude cljs/react-dom
somewhere?I follow this recipe, it it matters: https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/ReactCSSTransitionGroup
if you change the version of reagent to 0.6.1, then you will need to also update step 2 and use [cljsjs/react-with-addons "15.4.0-0"]
i just tried it with that version of react-with-addons & reagent 0.6.1 and recipe works
@gadfly361, I tried it with [cljsjs/react-with-addons “15.4.2-2”]
with no success
@gws: Yeah, I tried that, but this “context” thing seems to be different. Things like Redux use it to pass information down through children without explicitly passing props.
I’ve noticed that sometimes such definitions makes huge difference:
(defn concrete-container-1 [view-component]
[generic-container
:some-param-1
:some-param-2
view-component])
(def concrete-container-1
(partial generic-container
:some-param-1
:some-param-2))
specifically one with partial does not work properly (something like double rendering)
is there any explanation/documentation for that?
@gadfly361, hm. It’s getting weird. Doesn’t work with the latest 15.4.2-2. But I’ve just tried it with [cljsjs/react-with-addons “15.4.0-0”]
and it worked.
@negaduck i am guessing it is related to this: https://github.com/reagent-project/reagent/issues/251
nvm, findDOMNode still exists, just moved to ReactDOM and I think reagent looks for it there...so I'm not sure why that error happens with the bump in react version
@gadfly361, I’ll stick to an older version for now then. Thanks for help.