This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-09
Channels
- # announcements (26)
- # babashka (4)
- # beginners (17)
- # calva (21)
- # cider (13)
- # clerk (17)
- # clj-commons (23)
- # clj-kondo (3)
- # cljdoc (47)
- # cljsrn (10)
- # clojure (123)
- # clojure-belgium (2)
- # clojure-dev (25)
- # clojure-europe (34)
- # clojure-gamedev (2)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (4)
- # clojure-uk (4)
- # clojurescript (86)
- # cursive (12)
- # datahike (2)
- # datomic (2)
- # emacs (4)
- # fulcro (6)
- # funcool (15)
- # instaparse (1)
- # integrant (11)
- # jobs (1)
- # joyride (9)
- # kaocha (3)
- # membrane (8)
- # off-topic (1)
- # pathom (4)
- # practicalli (2)
- # quil (1)
- # rdf (1)
- # reagent (9)
- # remote-jobs (1)
- # shadow-cljs (27)
- # spacemacs (4)
- # specter (1)
- # sql (11)
- # tools-deps (55)
- # vim (1)
Hey having a spot of trouble moving a js function around.. getting a js object from a primereact component that contains an onClick handler in the payload.. and I need to map it to the onClick of the element its generating. Called thusly:
[:> TabPanel {:headerTemplate #(icon-tab-button % "mdiAccountFilter" "Filter Patients")}
(defn icon-tab-button [options icon label]
(let [click-handler (:onClick options)]
(reagent.core/as-element [:a {:on-click click-handler :role "tab" :class "p-tabview-nav-link"} [:span.p-tabview-title [pnx-icon icon "1rem"] label]])))
I can confirm the props are making it to the icon-tab-button function.. its there as a #js literal
Im not sure the correct syntax to set the javascript click handler in the options var to the anchor’s on-click, the code as supplied does not do the trick.
What does "does not do the trick" mean? Does nothing happen when you click it? Or is there an error? Does something else happen?