How to use a ReactJS Component with Clojurescipt/Reagent

╄→гoц情女王★ 提交于 2019-12-09 15:59:15

问题


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


回答1:


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"]]])


来源:https://stackoverflow.com/questions/27110425/how-to-use-a-reactjs-component-with-clojurescipt-reagent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!