Fork me on GitHub
Mitul Shah18:09:16

I’m trying to pass through the disabled attribute to a button but can’t seem to get it right HTML <button class="bg-red" disabled>Click</button> CLJS [:button {:class "bg-red" :disabled true} "Click"]


That looks correct to me.

Drew Verlee21:09:51

I'm getting an error that reagent.core/render (aliased as r below) is depreciated. What should i be using? my minimal setup

(defn root []
  [:h3 "hello world"])

(defn ^:dev/after-load start []
  (r/render [root]
            (.getElementById js/document "app")))

(defn init []



Drew Verlee21:09:11

Thanks. Huh. Maybe I misread the example I was looking at.


reagent.core/render was deprecated recently, v1.0.0 i think


or maybe 1.1


The fn was deprecated already in v0.10.0, v1.0 removed the implementation and added message pointing to the new namespace:

(defn render
  {:deprecated "0.10.0"}
  [& _]
  (throw (js/Error. "Reagent.core/render function was moved to reagent.dom namespace in Reagent v1.0.")))


The runtime error is only shown in browser console. Deprecation is shown during compilation so it isn't obvious to check the browser for reason, but there isn't really better way to communicate this in the library. Changelog mention this.

p-himik06:09:16 suggests using :superseded-by along with :deprecated. Not sure whether any tool picks it up though.


Doesn't seem like CLJS itself uses it.


Interesting! Yeah, I don't think compiler will use this, but maybe some other tool uses it, and no downside to adding that.