4
我正在嘗試在我的Clojurescript Reagent項目中使用react-router。問題是,反應路由器需要部件傳遞React.isValidClass(component)
,其在陣營0.11.2定義爲:Reagent生成一個React組件,它傳遞React.isValidClass(組件)?
ReactDescriptor.isValidFactory = function(factory) {
return typeof factory === 'function' &&
factory.prototype instanceof ReactDescriptor;
};
試劑似乎產生部件作爲對象,而不是一個函數。這裏是我的代碼:
(defn home []
[:div [:h1 "Home Page placeholder"]])
(reagent/as-component (home)) ; => #<[object Object]>
有沒有人已經制定了如何使這種互操作的工作?
我發現嘗試在github上做同樣的事情:https://github.com/ghedamat/reagent-react-router,可能會有所幫助。 – zarkone 2015-07-29 05:32:24