This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-07
Channels
- # aleph (4)
- # announcements (7)
- # arachne (1)
- # beginners (138)
- # calva (5)
- # cider (1)
- # clara (14)
- # clj-kondo (1)
- # cljsrn (2)
- # clojars (4)
- # clojure (247)
- # clojure-dev (33)
- # clojure-europe (3)
- # clojure-italy (71)
- # clojure-losangeles (6)
- # clojure-romania (6)
- # clojure-spain (11)
- # clojure-uk (17)
- # clojurescript (95)
- # core-async (2)
- # cursive (19)
- # datomic (7)
- # duct (27)
- # figwheel (1)
- # graalvm (22)
- # juxt (7)
- # kaocha (8)
- # leiningen (1)
- # luminus (7)
- # lumo (4)
- # off-topic (38)
- # reagent (4)
- # reitit (11)
- # shadow-cljs (30)
- # spacemacs (42)
- # tools-deps (103)
- # xtdb (5)
What is the best way to use react hooks with reagent? Many newer react libs come with react hooks and I wonder how to apply them.
Never mind, I found I can use [:> Component]
to use my component like a normal functional react component in which hooks work
I'm sorry - I already restructured to use hx
instead of reagent
as it fits my needs better and I need much less workarounds.
As to what I did to make it work with using Component
as normal react component, I remember I did something along the lines of:
(defn Component []
(let [[state, setState] (react/useState #js{})]
(reagent/as-element [:div .......])))
....
[:> Component]