Liking cljdoc? Tell your friends :D

std.lang.model.spec-js.jsx


emit-jsxclj

(emit-jsx arr grammar mopts)

can perform addition transformation if [:grammar :jsx] is false

(emit-jsx [:div {:className 'a} [:p '(hello 1 2 3)]] js/+grammar+ {:emit {:lang/jsx false}}) => (std.string/| "React.createElement(" " "div"," " {"className":a}," " React.createElement("p",{},hello(1,2,3))" ")")

can perform addition transformation if [:grammar :jsx] is false

(emit-jsx [:div {:className 'a}
           [:p '(hello 1 2 3)]]
          js/+grammar+
          {:emit {:lang/jsx false}})
=> (std.string/|
    "React.createElement("
    "  \"div\","
    "  {\"className\":a},"
   "  React.createElement(\"p\",{},hello(1,2,3))"
    ")")
raw docstring

emit-jsx-innerclj

(emit-jsx-inner arr grammar mopts)

emits the inner blocks for a jsx form

emits the inner blocks for a jsx form
raw docstring

emit-jsx-map-paramsclj

(emit-jsx-map-params params grammar mopts)

emits jsx map params

(emit-jsx-map-params '{:a (+ 1 2 3) :b "abc"} js/+grammar+ {}) => '("a={1 + 2 + 3}" "b="abc"")

emits jsx map params

(emit-jsx-map-params '{:a (+ 1 2 3) :b "abc"}
                     js/+grammar+
                     {})
=> '("a={1 + 2 + 3}" "b=\"abc\"")
raw docstring

emit-jsx-paramsclj

(emit-jsx-params params grammar mopts)

emits jsx params

(emit-jsx-params {:a 1 :b 2} js/+grammar+ {}) => [" " "a={1} b={2}"]

(emit-jsx-params '#{[a b (:.. c)]} js/+grammar+ {}) => [" " "a={a} b={b} {...c}"]

emits jsx params

(emit-jsx-params {:a 1 :b 2}
                 js/+grammar+
                 {})
=> [" " "a={1} b={2}"]

(emit-jsx-params '#{[a b (:.. c)]}
                 js/+grammar+
                 {})
=> [" " "a={a} b={b} {...c}"]
raw docstring

emit-jsx-rawclj

(emit-jsx-raw arr grammar mopts)

emits the jsx transform

(emit-jsx-raw [:div {:className 'a} [:p '(hello 1 2 3)]] js/+grammar+ {}) => "(\n <div className={a}><p>{hello(1,2,3)}</p></div>)"

emits the jsx transform

(emit-jsx-raw [:div {:className 'a}
               [:p '(hello 1 2 3)]]
              js/+grammar+
              {})
=> "(\n  <div className={a}><p>{hello(1,2,3)}</p></div>)"
raw docstring

emit-jsx-set-paramsclj

(emit-jsx-set-params params grammar mopts)

emits jsx set params

(emit-jsx-set-params '#{a b c} js/+grammar+ {}) => '(("a={a}" "c={c}" "b={b}"))

(emit-jsx-set-params '#{[a b (:.. c)]} js/+grammar+ {}) => '(("a={a}" "b={b}") "{...c}")

emits jsx set params

(emit-jsx-set-params '#{a b c}
                     js/+grammar+
                     {})
=> '(("a={a}" "c={c}" "b={b}"))

(emit-jsx-set-params '#{[a b (:.. c)]}
                     js/+grammar+
                     {})
=> '(("a={a}" "b={b}") "{...c}")
raw docstring

jsx-arr-normclj

(jsx-arr-norm arr)

normalises the jsx array

(jsx-arr-norm [:div]) => [:div {} nil]

normalises the jsx array

(jsx-arr-norm [:div])
=> [:div {} nil]
raw docstring

jsx-arr-prepclj

(jsx-arr-prep arr grammar mopts)

prepares jsx array

(jsx-arr-prep [:div {:className 'a} [:p '(hello 1 2 3)]] js/+grammar+ {}) => '[:div {:className a} [:p (hello 1 2 3)]]

prepares jsx array

(jsx-arr-prep [:div {:className 'a}
               [:p '(hello 1 2 3)]]
              js/+grammar+
              {})
=> '[:div {:className a} [:p (hello 1 2 3)]]
raw docstring

jsx-key-fnclj

(jsx-key-fn k)

converts jsx key

converts jsx key
raw docstring

jsx-standardise-paramsclj

(jsx-standardise-params params)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close