Fork me on GitHub
#rum
<
2017-06-09
>
zcaudate01:06:11

I'm not sure how to get external components to work with rum and googling just yields this: https://github.com/tonsky/rum/issues/20

zcaudate01:06:53

there is soda-ash, which is a semantic-ui library for reagent. but I like mixins

zcaudate02:06:01

got it working... but is there a better way?

(defcs home-page [state]
  [:div {:on-click (start-drag state)}
   [:h2 "home"]
   (js/React.createElement js/semanticUIReact.Card
     #js {}
     (js/React.createElement js/semanticUIReact.Card.Content
       #js {} 
       (js/React.createElement js/semanticUIReact.Card.Header
        #js {} "Matthew")))])

jimmy06:06:06

you can extract those React.createElement to another function, it would look cleaner.

misha08:06:29

@zcaudate this is what I have for react native components:

(defn create-element [rn-comp opts & children]
  (apply js/React.createElement rn-comp (clj->js opts) children))

(def view (partial create-element (.-View ReactNative)))

;; and later:

(rum/defc foo []
  (view {:key a}
    (h3 {} "bar")))