Fork me on GitHub

(defn item
  [:div "item"]        ;;  <------  added 
  #_(reagent/create-class    ;; <--   commented out via #_
    {:component-did-mount #(println "foo")
     (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?


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

Stefan Roex17:04:14

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

Stefan Roex18:04:10

Hmm, the error-ing component will probably return nil, but its still a bummer that it requires a page-refresh afterwards

Stefan Roex18:04:40

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.

Stefan Roex19:04:44

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...

Stefan Roex20:04:41

@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

Stefan Roex20:04:42

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.


hope you figure it out, good luck! simple_smile

Stefan Roex20:04:11

Translated the example to om, and seems to work without a problem.


coming from om+ fighwheel recently, I also noticed that reagent+figwheel doesn't handle errors as gracefully (usually requiring a refresh)