     (assert false "getDefaultProps not supported yet")
     
     :getInitialState
-    (fn [C]
-      (when f
-        (aset C cljs-state (merge (state C) (f C)))))
+    (fn []
+      (this-as C
+               (when f
+                 (aset C cljs-state (merge (state C) (f C))))))
 
     :componentWillReceiveProps
-    (fn [C props]
-      (when f (f C (aget props cljs-argv))))
+    (fn [props]
+      (this-as C
+               (when f (f C (aget props cljs-argv)))))
 
     :shouldComponentUpdate
-    (fn [C nextprops nextstate]
-      ;; Don't care about nextstate here, we use forceUpdate
-      ;; when only when state has changed anyway.
-      (let [inprops (js-props C)
-            old-argv (aget inprops cljs-argv)
-            new-argv (aget nextprops cljs-argv)]
-        (if (nil? f)
-          (not (util/equal-args old-argv new-argv))
-          (f C old-argv new-argv))))
+    (fn [nextprops nextstate]
+      (this-as C
+               ;; Don't care about nextstate here, we use forceUpdate
+               ;; when only when state has changed anyway.
+               (let [inprops (js-props C)
+                     old-argv (aget inprops cljs-argv)
+                     new-argv (aget nextprops cljs-argv)]
+                 (if (nil? f)
+                   (not (util/equal-args old-argv new-argv))
+                   (f C old-argv new-argv)))))
 
     :componentWillUpdate
-    (fn [C nextprops]
-      (let [next-argv (aget nextprops cljs-argv)]
-        (f C next-argv)))
+    (fn [nextprops]
+      (this-as C
+               (let [next-argv (aget nextprops cljs-argv)]
+                 (f C next-argv))))
 
     :componentDidUpdate
-    (fn [C oldprops]
-      (let [old-argv (aget oldprops cljs-argv)]
-        (f C old-argv)))
+    (fn [oldprops]
+      (this-as C
+               (let [old-argv (aget oldprops cljs-argv)]
+                 (f C old-argv))))
 
     :componentWillUnmount
-    (fn [C]
-      (let [ratom (.-cljsRatom C)]
-        (if-not (nil? ratom)
-          (ratom/dispose! ratom)))
-      (set! (.-cljsIsDirty C) false)
-      (when f (f C)))
+    (fn []
+      (this-as C
+               (let [ratom (.-cljsRatom C)]
+                 (if-not (nil? ratom)
+                   (ratom/dispose! ratom)))
+               (set! (.-cljsIsDirty C) false)
+               (when f (f C))))
 
     nil))
 

      (this-as C (apply f C args)))
    f))

(def dont-wrap #{:cljsRender})

(defn get-wrapper [key f name]
  (if (dont-wrap key)

      (when (and wrap f)
        (assert (fn? f)
                (str "Expected function in " name key " but got " f)))
      (or wrap (default-wrapper f)))))

(def obligatory {:shouldComponentUpdate nil
                 :componentWillUnmount nil})
