This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-01
Channels
- # announcements (10)
- # aws (1)
- # babashka (19)
- # beginners (104)
- # calva (50)
- # cider (17)
- # cljs-dev (135)
- # cljsrn (56)
- # clojure (240)
- # clojure-dev (4)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-uk (7)
- # clojurescript (22)
- # conjure (2)
- # css (1)
- # cursive (10)
- # data-science (1)
- # datomic (60)
- # emacs (2)
- # events (2)
- # exercism (1)
- # figwheel-main (3)
- # fulcro (13)
- # graalvm (5)
- # gratitude (1)
- # inf-clojure (4)
- # introduce-yourself (5)
- # jobs-discuss (21)
- # lsp (36)
- # malli (6)
- # meander (8)
- # missionary (12)
- # off-topic (14)
- # pathom (13)
- # pedestal (10)
- # polylith (42)
- # re-frame (5)
- # reagent (12)
- # reitit (3)
- # releases (8)
- # sci (10)
- # shadow-cljs (37)
- # sql (5)
- # tools-deps (6)
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"]
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 []
(start))
Thanks. Huh. Maybe I misread the example I was looking at.
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.
https://guide.clojure.style/#superseded-by suggests using :superseded-by
along with :deprecated
. Not sure whether any tool picks it up though.
Interesting! Yeah, I don't think compiler will use this, but maybe some other tool uses it, and no downside to adding that.