    (fn [{:keys [refs props locals]}]
      (let [{:keys [mode line-numbers? read-only? text]} props]
        (swap! locals assoc :code-mirror-instance
-              ((get-codemirror) (react/find-dom-node (@refs "container"))
+              (@codemirror-instance (react/find-dom-node (@refs "container"))
                (clj->js
                 (merge
                  (when text {:value text})

          (not loaded?) [ScriptLoader
                         {:on-error #(swap! state assoc :error? true)
                          :on-load (fn []
                                     (when-not @wdl-defined?
                                       (define-wdl))
                                     (this :-display-code)
                                     (when-let [init (:initialize props)]

     (this :call-method "off" event-type listener))
   :call-method
   (fn [{:keys [locals]} method & args]
     (apply js-invoke (aget @codemirror-instance "doc") method args))
   :get-default-props
   (fn []
     {:line-numbers? true
