    or not the root component is a JS component.
 
    The root component is expected to accept the properties
-   defined for screens, so `:layout` and arbitrary other forms.
-   `:layout` is a map of layout keys to instantiated components.
+   defined for screens, so `:sections` and arbitrary other forms.
+   `:sections` is a map of section keys to instantiated components.
    The root component can then decide which of these components
-   to render where based on these layout keys.
+   to render where based on these section keys.
 
    During rendering, the provided root component is wrapped
    in an application component that handles the screen routing
-   logic and generates the `:layout` and other form props
+   logic and generates the `:sections` and other form props
    based on the active screen."
   [{:keys [default-screen reconciler root
            root-js? target screen-mounted]

  [_ {:keys [screen]} _ _]
  {:value (:forms screen)})

(defn read-layout
  "Executes all queries for views in the layout of the
   active screen."
  [_ {:keys [parser query screen] :as env} _ _]
  {:value
   (reduce (fn [res layout-item]
             (let [[section query] (first layout-item)]
               (assoc res section
                      {:view  (-> screen :layout section
                                  resolve-view :factory)
                       :props (parser (dissoc env :path) query nil)})))
           {} query)})


        m))

(defview RootWrapper
  (query [{workflo/screen [workflo [forms sections]]}])
  (render
   (let [forms      (:workflo/forms screen)
         sections   (realize-sections (:workflo/sections screen))
         root-info  (root-component)]
     ((:factory root-info)
      (if (:js? root-info)
        (do
          (clj->js (merge {:sections (camel-cased-prop-map sections)}
                          (camel-cased-prop-map forms))))
        (merge {:sections sections} forms))))))

;;;; Routing

(defn mount-screen
  "Mounts a screen with parameters by setting it as the active
   screen and updating the root wrapper's component query
   according to the screen's sections."
  [app screen params]
  (let [c     (om/app-root (:reconciler (:config app)))
        query [{:workflo/screen
                [:workflo/forms
                 {:workflo/sections
                  (mapv (fn [[section view-name]]
                          {section (or (some-> view-name resolve-view :view om/get-query)
                                       [])})
                        (:sections screen))}]}]]
    (set-active-screen! screen params)
    (some-> app :config :screen-mounted
            (apply [app screen params]))
