(cached-custom-prop-name k)
(cached-prop-name k)
(camel-case-dom k)
Turns kebab-case keyword into camel-case keyword, kebab-cased DOM attributes aria-* and data-* are not converted
Turns kebab-case keyword into camel-case keyword, kebab-cased DOM attributes aria-* and data-* are not converted
(camel-case-keys m)
Takes map of attributes and returns same map with camel-cased keys
Takes map of attributes and returns same map with camel-cased keys
(class-names a)
(class-names a b)
(class-names a b & rst)
Merges a collection of class names into a string
Merges a collection of class names into a string
(class-names-coll classes)
(compile-attrs attrs)
(compile-attrs attrs {:keys [custom-element?]})
Takes map of attributes and returns same map with keys translated from Clojure to React naming conventions
:class -> :className :margin-right -> :marginRight :on-click -> :onClick
Takes map of attributes and returns same map with keys translated from Clojure to React naming conventions :class -> :className :margin-right -> :marginRight :on-click -> :onClick
(convert-custom-prop-value x)
(convert-interop-prop-value k v)
(convert-prop-value x)
(convert-prop-value-shallow x)
(convert-props props id-class shallow?)
Converts props
Clojure map into JS object suitable for
passing as props
object into React.createElement
props
— Clojure map of propsid-class
— a triplet of parsed tag, id and class namesshallow?
— indicates whether props
map should be converted shallowly or notConverts `props` Clojure map into JS object suitable for passing as `props` object into `React.createElement` - `props` — Clojure map of props - `id-class` — a triplet of parsed tag, id and class names - `shallow?` — indicates whether `props` map should be converted shallowly or not
(convert-value v)
(convert-value k v)
(convert-values m)
(custom-kv-conv o k v)
(dash-to-camel name-str)
(interpret-attrs maybe-attrs id-class shallow?)
Returns a tuple of attributes and a child element
attrs
is actually a map of attributesattrs
is not a map, thus a child elementReturns a tuple of attributes and a child element - [attrs] when `attrs` is actually a map of attributes - [nil attrs] when `attrs` is not a map, thus a child element
(interpret-props props)
Returns a tuple of component props and a child element
props
is actually a map of attributesprops
is not a map, thus a child elementReturns a tuple of component props and a child element - [props] when `props` is actually a map of attributes - [nil props] when `props` is not a map, thus a child element
(js-val? x)
(keyword->string x)
(kv-conv o k v)
(kv-conv-shallow o k v)
(parse-tag tag)
Takes HyperScript tag (:div#id.class) and returns parsed tag, id and class fields, and boolean indicating if tag name is a custom element (a custom DOM element that has hyphen in the name)
Takes HyperScript tag (:div#id.class) and returns parsed tag, id and class fields, and boolean indicating if tag name is a custom element (a custom DOM element that has hyphen in the name)
HyperScript tag pattern :div :div#id.class etc.
HyperScript tag pattern :div :div#id.class etc.
(set-id-class props [_ id class])
Takes attributes map and parsed tag triplet, and returns attributes merged with class names and id
Takes attributes map and parsed tag triplet, and returns attributes merged with class names and id
(set-id-class props id-class)
Takes attributes map and parsed tag, and returns attributes merged with class names and id
Takes attributes map and parsed tag, and returns attributes merged with class names and id
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close