 
   See the genspec docstring for spec.
 
+  Defaults:
+  
   Within methods, the components this object is bound to `this`.  It
   can be overriden using the :this-as option in spec.
+
+  The React displayName is set to the name of the factory function by
+  default.
 
 
   React attributes:

               ;; deep merge on ClojureScript datastructures.
               form))))]))

(defmacro genspec
  "Generate a spec suitable for React.createClass.


  (let [[docstr prop-binding spec]
        (if (string? prop-binding)
          [prop-binding (first spec) (rest spec)]
          [nil prop-binding spec])
        [opts spec] (extract-opts spec)]
    (assert (vector? prop-binding))
    `(def ~name
       ~@(if docstr
           [docstr])
       (let [c# (js/React.createClass
                 ~(genspec* prop-binding
                            (merge {:this-as 'this}
                                    opts)
                            (concat ['displayName (str name)]
                                     spec)))]
         (fn
           ([]
            (js/React.createElement c# (cljs.core/js-obj)))
