This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-13
Channels
- # announcements (1)
- # babashka (30)
- # beginners (43)
- # biff (24)
- # calva (72)
- # cider (12)
- # clj-commons (24)
- # clj-on-windows (10)
- # cljsrn (23)
- # clojure (123)
- # clojure-bay-area (6)
- # clojure-europe (43)
- # clojure-losangeles (2)
- # clojure-nl (2)
- # clojure-uk (9)
- # clojurescript (125)
- # core-async (9)
- # cursive (2)
- # data-science (3)
- # datomic (30)
- # devops (1)
- # emacs (13)
- # events (5)
- # fulcro (15)
- # graalvm (3)
- # gratitude (1)
- # humbleui (11)
- # lsp (5)
- # nbb (24)
- # off-topic (11)
- # pedestal (5)
- # releases (1)
- # remote-jobs (1)
- # sci (15)
- # scittle (16)
- # shadow-cljs (15)
- # sql (11)
- # tools-deps (9)
- # xtdb (5)
I could simply use (react/memo MyComponent are-equal?)
, but it's tricky to write are-equal?
for a defsc
component, as one need to know that all props are hoisted in a fulcro$props
field, etc.
It is not at all clear to me what your ultimate goal is. Are you trying to get shouldComponentUpdate for a hooks component?
I’d have to play with it…just woke up and am too sleepy to invent the equivalent on the fly. are-equal?
is trivial, and I think it should just work given the pattern in the React docs.
(defn are-equal? [^js a ^js b]
(= (.-fulcro$value a) (.-fulcro$value b)))
For my particular application, it is a small client-only component at the tip of the UI tree. So eventually I decided to skip defsc and use native react functions. But sure, I can give your suggestion a try.
In rad report controls I would like that checkbox label is aligned with other controls:
So far I found only one way to put label above checkbox in a form:
(sui/ui-form-field
{}
(dom/label "Test too?")
(sui/ui-checkbox {:checked (or test-too false)
:onChange #(m/toggle! this :ui/test-too)}))