This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-08
Channels
- # announcements (22)
- # aws (4)
- # babashka (25)
- # beginners (78)
- # calva (9)
- # cider (22)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (27)
- # clojure-australia (7)
- # clojure-europe (22)
- # clojure-nl (15)
- # clojure-uk (26)
- # clojurescript (20)
- # datahike (3)
- # datomic (15)
- # events (1)
- # helix (5)
- # honeysql (4)
- # kaocha (1)
- # malli (1)
- # meander (1)
- # off-topic (84)
- # pathom (14)
- # re-frame (3)
- # reagent (28)
- # reitit (6)
- # sci (1)
- # shadow-cljs (78)
- # tools-deps (30)
How can I access a the underlying dom node from within a component? I'm trying to wrap a vanilla js library in a component nevermind, I got it!
3
Thanks! And, also for future users, the general helix pattern is this:
(defnc my-lib-component [{:keys [opts] :as props}]
(let [ref (hooks/use-ref nil)
d (d/div {:ref ref})]
(hooks/use-effect []
(MyLibConstructor. opts @ref))
d))
Where my lib-constructor is a vanilla js lib that takes a dom node in the constructor