 
 (defn- define-wdl []
   (js-invoke
-   @codemirror-instance "defineMode" "wdl"
+   @codemirror-constructor "defineMode" "wdl"
    (fn []
      #js{:token (fn [stream]
                   (.eatSpace stream)

   :component-will-receive-props
   (fn [{:keys [props next-props locals]}]
     (when (:read-only? props)
       (-> (@locals :code-mirror-instance)
           (js-invoke "getDoc")
           (js-invoke "setValue" (:text next-props)))))})

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