Liking cljdoc? Tell your friends :D

pump.macros


body-mapclj

(body-map forms)
source

dash-to-camel-keysclj

(dash-to-camel-keys hashmap)
source

dash-to-camel-nameclj

(dash-to-camel-name k)
source

dash-to-camel-strcljmacro

(dash-to-camel-str dashed)
source

defrcljmacro

(defr name & forms)

Macro for defining React components

In most basic forms takes a map of function names to functions, converts them from dashed-version to camelCasedVersion, adds displayName and passes to pump.core/react.

Can also accept more advanced form:

(defr Component [C P S] (some-fn P) [:div.class (:text P)])

This example only shows how render function is defined. If you need to define more (some life cycle functions, for example), define them before defining render arguments:

(defr Component :component-will-mount #(.log js/console "component on duty") [C P S] [:div.class (:text P)])

Macro for defining React components

In most basic forms takes a map of function names to functions, converts them
from dashed-version to camelCasedVersion, adds displayName and passes to
pump.core/react.

Can also accept more advanced form:

  (defr Component
    [C P S]
    (some-fn P)
    [:div.class (:text P)])

This example only shows how render function is defined. If you need to define
more (some life cycle functions, for example), define them before defining
render arguments:

  (defr Component
    :component-will-mount #(.log js/console "component on duty")
    [C P S]
    [:div.class (:text P)])
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close