This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-22
Channels
- # admin-announcements (7)
- # beginners (56)
- # boot (69)
- # cider (168)
- # cljs-dev (2)
- # clojure (170)
- # clojure-austin (25)
- # clojure-beijing (3)
- # clojure-belgium (2)
- # clojure-france (3)
- # clojure-poland (17)
- # clojure-russia (115)
- # clojure-uk (40)
- # clojurebridge (3)
- # clojurescript (87)
- # cursive (9)
- # datomic (30)
- # dirac (18)
- # editors (3)
- # emacs (14)
- # hoplon (195)
- # immutant (14)
- # jobs (3)
- # jobs-discuss (4)
- # leiningen (11)
- # melbourne (5)
- # mount (42)
- # off-topic (5)
- # om (24)
- # onyx (48)
- # parinfer (53)
- # proton (1)
- # protorepl (2)
- # re-frame (3)
- # reactive (2)
- # reagent (29)
- # rum (5)
- # spacemacs (4)
- # untangled (91)
- # yada (1)
(defn item
[i]
[:div "item"] ;; <------ added
#_(reagent/create-class ;; <-- commented out via #_
{:component-did-mount #(println "foo")
:reagent-render
(fn [i]
[:div.item {:class (item-class i)}]
[:div.attr (:retailer_name i)]]
)}))
Do see "item"? My guess is that you won't. Ie. there is nothing wrong with this component. The issue will be elsewhere
But, if you do see "item", then yes, there's an issue with this use of reagent/create-class
commented out part doesnt work, the one below, with just the hiccup, does
one thing that might be relevant is that this is being only rendered by another component
maybe something about that render-coll
helper? But yeah, that would still imply that components created in this style have to be handled differently, which doesn’t make sense. Everything I am seeing says these are two ways to create an identical component
Instead of (component i)
you need [component i]
that did it, thanks. Will read up on the usage differences
@mikethompson: reading your stackoverflow answer on multimethods and reagent: so multimethods don't play well with Form-2 reagent components. They do seem to work with Form-1 reagent components. Is my understanding correct?
Anyone have suggestions/examples on a good way to add basic charts (bar, line, etc) to a Reagent/Re-Frame app?
@juliobarros https://github.com/reagent-project/reagent-cookbook/blob/master/recipes/morris/README.md
Thanks @gadfly361 are you using Morris? Had heard of some folks using Vega and was wondering what all the cool kids liked 😄
i haven't decided on a preferred library yet (never heard of vega, but will check it out now!). Curious what other people like to use
Does anyone know about a Uncaught TypeError: Cannot read property '_currentElement' of null
error? I get this error every time an error occurs in an component and try to interact with the application. Even if figwheel reloads the code without the error, the TypeError continues, forcing me to refresh the page.
You might be calling a component that is nil, like [foo-component]
where foo-component is nil
Hmm, the error-ing component will probably return nil, but its still a bummer that it requires a page-refresh afterwards
I’m creating a minimal app with the same error. Will post a link to github in a moment.
I think we are on the same page, but no harm in extra clarification. I was referring to the var foo-component
itself having a value of nil. It'd be like calling a component like this [nil "some text"]
(which will throw an error) as opposed to this [:div "some text"]
. So if foo-component
is nil, then [foo-component "some text"]
wont return nil, it will throw an error.
I’m not sure that is what happens. I’ve created an example repository so you’re able to reproduce the error
@stex, able to reproduce. Tried a few things: 1) moving your (r/render ...)
inside a function that figwheel calls on reload, and 2) making sure sub-component1 is getting passed new params. Neither made a reliable difference. When I run into this, i do just refresh the page...
@gadfly361: Thanks. But seems odd, doesn’t it? Breaks the whole fighwheel workflow for us at our company. We aren’t perfect and make mistakes during development. Havent heart anyone else about this.
I think if you get a significant runtime error like that, figwheel gets in a funky state. My naive understanding of figwheel is that it pushes diffs. So since figwheel pushed something broken, even if what comes after it is good, the broken bit that was pushed before isn't successfully replaced and instead persists (at least to some degree). Could be entirely wrong tho lol
Figwheel unmounts and mounts all components, so theoretically it could start with a clean slate after a reload. I’ll try a few things next week, if I’ll find anything I’ll post it here.
Translated the example to om, and seems to work without a problem.