如何在Clojurescipt/Reagent中使用ReactJS组件 [英] How to use a ReactJS Component with Clojurescipt/Reagent
本文介绍了如何在Clojurescipt/Reagent中使用ReactJS组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在Clojurescript中包装ReactJS组件以与 Reagent 一起使用?我已经阅读了.有人可以给我提供一个基本的例子吗?
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?
谢谢
推荐答案
Here is my solution for it (I am going to use a React-Bootstrap Panel Component):
1)在HTML中包含react-bootstrap.min.js
.
1) Include react-bootstrap.min.js
in your html.
2)以下是Panel组件的用法示例:
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"]]])
这篇关于如何在Clojurescipt/Reagent中使用ReactJS组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文