           (if (.-substring attr-value) ;; tests if attr-value is a string
             attr-value
             (.toString attr-value)))
-        (.removeAttribute element attr-name)))))
+        (.removeAttribute element attr-name))
+      attr-value)))
 
 (defn- bind-lifecycle-callback! [node node-state cb-name cb-value]
   (when (identical? cb-name "on-disposed")
     (set! (.-disposed-callback node-state) cb-value)
     ;; other callbacks automatically included in attr map
-    ))
+    )
+  cb-value)
 
 (def ^:private attr-ns-lookup
   #js
   {:node bind-lifecycle-callback!
-   :state (fn []) ;; automatically handled in attr map
+   :state (fn [_ _ _ v] v) ;; automatically handled in attr map
    })
 
 (defn register-attr-prefix! [prefix xml-ns-or-handler]

          (if (.-substring prop-value)
            prop-value
            (.toString prop-value)))
    (js-delete (.-style elem) prop-name)))

(defn- remove-style-prop! [elem prop-name]
  (js-delete (.-style elem) prop-name))


(def ^:private attr-setters
  #js
  {:data-state (fn [element state]
                 (set-data-state! element state)
                 state)
   :class (fn [element cls]
               (set! (.-className element) cls)
               cls)
   ;; :id (fn [element id] (set! (.-id element) id))
   })

