This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-16
Channels
- # beginners (81)
- # calva (6)
- # cider (21)
- # clj-kondo (2)
- # clojure (62)
- # clojure-austin (3)
- # clojure-europe (3)
- # clojure-italy (20)
- # clojure-nl (39)
- # clojure-russia (4)
- # clojure-spec (19)
- # clojure-uk (23)
- # clojurescript (76)
- # cursive (6)
- # data-science (9)
- # datomic (12)
- # defnpodcast (1)
- # figwheel-main (3)
- # fulcro (8)
- # jackdaw (5)
- # jobs (1)
- # jobs-discuss (18)
- # joker (1)
- # leiningen (2)
- # liberator (2)
- # off-topic (148)
- # onyx (5)
- # pedestal (39)
- # planck (7)
- # re-frame (5)
- # reagent (3)
- # reitit (37)
- # shadow-cljs (165)
- # tools-deps (1)
- # yada (19)
@weavejester I’m using Draft.js with reagent. Got it working by using adapt-react-class
and mounting the component in a form-2 comonent. editor-state
is an ratom
.
(def Editor
(reagent/adapt-react-class
(gobj/get draft-js "Editor")))
(def EditorState
(gobj/get draft-js "EditorState"))
;; Render Method
;; ...
[Editor {:editorState @editor-state
:customStyleMap (clj->js style-map)
:handleKeyCommand (partial handle-key-command editor-state)
:onChange #(do
(reset! editor-state %)
(on-change))
:ref #(reset! !ref %)}]