Fork me on GitHub
#reagent
<
2017-04-15
>
conaw10:04:39

Hey does anyone online have any experience wrapping react components?

conaw10:04:54

this helped a great deal

pesterhazy11:04:03

scroll down for a live demo of react-select

pesterhazy11:04:25

well not the same as react-selectable but you should get the idea

conaw11:04:51

(def scomp js/Selectable.createSelectable)


(defn sbutton [i]
  [:button {:style {

                    :padding "40px"}}
   (:children i)])

(def btn (reagent/adapt-react-class (scomp (r/reactify-component sbutton))))  
this did the trick for me

conaw11:04:24

just was combo of reactify-component and adapt-react-class which had me

pesterhazy11:04:28

Yup that looks about right

pesterhazy11:04:42

you need to basically convert in both directions react->reagent and reagent->react

pesterhazy11:04:31

you might also be interested in the [:> some-react-component] shortcut and the r/as-element function