8

Is it possible to wrap ReactJS components for use with Reagent in Clojurescript? I have read that it is. Can someone provide me with a basic example?

Thanks

ducky
  • 1,113
  • 1
  • 11
  • 23

1 Answers1

7

Here is my solution for it (I am going to use a React-Bootstrap Panel Component):

1) Include react-bootstrap.min.js in your html.

2) Here is a sample usage of the Panel component:

(def PanelComp (. js/ReactBootstrap -Panel))
(defn page
  []
  [:div
   [:div [PanelComp {:header "Panel heading without title"} "Panel content"]]])
Kris Jenkins
  • 4,083
  • 30
  • 40
ducky
  • 1,113
  • 1
  • 11
  • 23
  • 4
    Reagent 0.5.0 added a new way of doing this using `adapt-react-class`. I've got a sample use [here](https://gist.github.com/ducky427/10551a3346695db6a5f0) – ducky Jun 16 '15 at 09:56