From 91a8587b7938c4ad544867b62179193aad9b440f Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Thu, 22 Oct 2015 15:11:15 +0200 Subject: [PATCH] Make core/react a function That allows us to make react loading lazy in the future. --- src/reagent/core.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/reagent/core.cljs b/src/reagent/core.cljs index 3d04cdc..635e3cb 100644 --- a/src/reagent/core.cljs +++ b/src/reagent/core.cljs @@ -13,7 +13,8 @@ (def is-client util/is-client) -(def react util/react) +(defn react [] + util/react) (defn create-element "Create a native React element, by calling React.createElement directly. @@ -33,13 +34,13 @@ which is equivalent to (create-element type nil)) ([type props] (assert (not (map? props))) - ($ react createElement type props)) + ($ (react) createElement type props)) ([type props child] (assert (not (map? props))) - ($ react createElement type props child)) + ($ (react) createElement type props child)) ([type props child & children] (assert (not (map? props))) - (apply ($ 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."