From af45084966c2643f672d5639ecdd9dfdfe95c294 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Fri, 3 Jan 2014 16:38:28 +0100 Subject: [PATCH] Remove support for refs for now It shouldn't be necessary for Cloact, since we can share data between components using atoms. And it was broken and untested anyway... --- src/cloact/core.cljs | 3 --- src/cloact/impl/template.cljs | 5 +---- test/demo.cljs | 6 +++--- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/cloact/core.cljs b/src/cloact/core.cljs index e13f556..ca71c12 100644 --- a/src/cloact/core.cljs +++ b/src/cloact/core.cljs @@ -51,9 +51,6 @@ (defn dom-node [comp] (.getDOMNode comp)) -(defn refs [comp] - (aget comp "refs") - #_(.-refs comp)) (defn merge-props diff --git a/src/cloact/impl/template.cljs b/src/cloact/impl/template.cljs index 1a6ca6a..7908c76 100644 --- a/src/cloact/impl/template.cljs +++ b/src/cloact/impl/template.cljs @@ -134,10 +134,7 @@ (when (map? props) (let [key (:key props)] (when-not (nil? key) - (set! (.-key obj) key))) - (let [ref (:ref props)] - (when-not (nil? ref) - (set! (.-ref obj) ref)))) + (set! (.-key obj) key)))) (c obj))) (defn map-into-array [f coll] diff --git a/test/demo.cljs b/test/demo.cljs index 6f5fd79..3e265b7 100644 --- a/test/demo.cljs +++ b/test/demo.cljs @@ -208,9 +208,9 @@ Hiccup-like syntax."] [:div [:h2 "Essential API"] - [:p "Cloact supports (almost) the entire React API, but there is - really only one entry-point that is necessary for most - applications: " [:code "cloact.core/render-component"] "."] + [:p "Cloact supports most of React's API, but there is really only + one entry-point that is necessary for most applications: " + [:code "cloact.core/render-component"] "."] [:p "It takes too arguments: a component, and a DOM node. For example, splashing the very first example all over the page would