diff --git a/project.clj b/project.clj index 71a6fb5..65a08fb 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject cljs-react-reload "0.1.1" +(defproject org.clojars.borkdude/cljs-react-reload "0.1.2-SNAPSHOT" :description "A library to define React classes that maintain local state on reload." :url "https://github.com/bhauman/cljs-react-reload" :license {:name "Eclipse Public License" diff --git a/src/cljs_react_reload/core.clj b/src/cljs_react_reload/core.clj index 19b05eb..a3ded86 100644 --- a/src/cljs_react_reload/core.clj +++ b/src/cljs_react_reload/core.clj @@ -3,16 +3,16 @@ [cljs.env :as env])) (defmacro def-react-class [vname body] - `(def ~vname (js/React.createClass ~body))) + `(def ~vname (js/createReactClass ~body))) (defmacro defonce-react-class "Creates a stable base React class and then patches it on reload." [vname body] (if (and env/*compiler* - (let [{:keys [optimizations]} (get env/*compiler* :options)] - (or (nil? optimizations) (= optimizations :none)))) + (let [{:keys [optimizations]} (get env/*compiler* :options)] + (or (nil? optimizations) (= optimizations :none)))) `(let [base# ~body] - (defonce ~vname (js/React.createClass base#)) + (defonce ~vname (js/createReactClass base#)) (doseq [property# (map name '(shouldComponentUpdate @@ -25,4 +25,4 @@ render))] (when (aget base# property#) (aset (.-prototype ~vname) property# (aget base# property#))))) - `(defonce ~vname (js/React.createClass ~body)))) + `(defonce ~vname (js/createReactClass ~body))))