     '[:maze])
   Object
   (componentDidMount [this]
-    (animate-if-active (om/props this)))
+    (animate-if-active (om/props this) (om.next/react-ref this "maze-canvas")))
   (componentDidUpdate [this _ _]
-    (animate-if-active (om/props this)))
+    (animate-if-active (om/props this) (om.next/react-ref this "maze-canvas")))
   (render [this]
     (let [{:keys [animation params]} (om/props this)
           {:keys [rows columns cell-size]} params

       (and (integer? rows) (> rows 1) (< rows 100))
       (and (integer? columns) (> columns 1) (< columns 100))))

(defn animate-if-active [{:keys [animation params]}]
  (let [{:keys [active grid animator]} animation
        {:keys [cell-size]} params]
    (when active
      (protocols/animate-frame animator grid cell-size @thecanvas))))

(defui MazeDisplay
  static om/IQuery

                 (dom/canvas #js {:id     "c1"
                                  :height height
                                  :width  width
                                  :ref "maze-canvas"})
                 )))))

(def maze-display (om/factory MazeDisplay))
