From 92984c4c56dce8866e164a4718ab725d3400f82e Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Mon, 12 Oct 2015 17:29:03 +0200 Subject: [PATCH] Add react to core for convenience --- src/reagent/core.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/reagent/core.cljs b/src/reagent/core.cljs index cc74999..e63f16c 100644 --- a/src/reagent/core.cljs +++ b/src/reagent/core.cljs @@ -13,6 +13,8 @@ (def is-client util/is-client) +(def react util/react) + (defn create-element "Create a native React element, by calling React.createElement directly. @@ -31,13 +33,13 @@ which is equivalent to (create-element type nil)) ([type props] (assert (not (map? props))) - (.' util/react createElement type props)) + (.' react createElement type props)) ([type props child] (assert (not (map? props))) - (.' util/react createElement type props child)) + (.' react createElement type props child)) ([type props child & children] (assert (not (map? props))) - (apply (.' util/react :createElement) type props child children))) + (apply (.' react :createElement) type props child children))) (defn as-element "Turns a vector of Hiccup syntax into a React element. Returns form unchanged if it is not a vector."