 ;; convenience access methods
 
 (defn mounted? [c]
-  (.isMounted c))
+  (and c (.isMounted c)))
 
 (defn force-update! [this]
   (when (mounted? this)
     (try (.forceUpdate this)
          (catch js/Error e
-           (if-let [on-error (.-onError this)]
+           (if-let [on-error (aget this "onError")]
              (on-error e)
              (do (.debug js/console "No :on-error method in component" this)
                  (.error js/console e)))))))

   (fn [get-initial-state-fn]
     (fn []
       (this-as this
         (let [initial-props (expand-props this (.. this -props -cljs$props))
               initial-state (merge (when get-initial-state-fn (get-initial-state-fn this initial-props))
                                    (initial-subscription-data this initial-props))]
           (d/transact! db [{:id         this
                             :props      initial-props
                             :view-id    (or (:view-id initial-props) (:id initial-props))
                             :children   (.. this -props -cljs$children)
                             :state      initial-state
                             :prev-state initial-state}])))))


     (fn [props]

       (this-as this
         (let [{prev-props :props prev-children :children} (d/entity @db this)
               next-props (expand-props this (js-get props "cljs$props"))
               next-children (js-get props "cljs$children")]

           (d/transact! db [{:id            this
                             :prev-props    prev-props
                             :props         next-props
                             :view-id       (or (:view-id next-props) (:id next-props))
                             :prev-children prev-children
                             :children      next-children}])

           (binding [*trigger-state-render* false
                     *use-prior-props* true]
