                  (dom/canvas #js {:id     "c1"
                                   :height height
                                   :width  width
-                                  :ref    (fn [c]
-                                            (when-not (nil? c)
-                                              (reset! thecanvas c)))})
+                                  :ref "maze-canvas"})
                  )))))
 
 (def maze-display (om/factory MazeDisplay))

      (xact! reconciler
             (snergly.core/set-status {:status msg})
             (snergly.core/set-grid {:grid grid})))))

;; I shouldn't have to do this; the "right way", apparently, is to set the
;; ref as a property on the component.  And that works great in figwheel
;; development mode, but in a production build with optimizations on, it
;; doesn't work at all.  This is the only way I've been able to get it to
;; work in both.
(def thecanvas (atom nil))

(def init-data
  {;; application initialization

    '[:maze])
  Object
  (componentDidMount [this]
    (animate-if-active (om/props this) (om.next/react-ref this "maze-canvas")))
  (componentDidUpdate [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
