(children props)
Given a props object, returns children contained in it (if any).
Handles cases where props could be either a JS object or a CLJS structure.
Given a props object, returns children contained in it (if any). Handles cases where props could be either a JS object or a CLJS structure.
(count children)
Returns the total number of components in children, equal to the number of times that a callback passed to map would be invoked.
Returns the total number of components in children, equal to the number of times that a callback passed to map would be invoked.
(map f children)
Map children that are typically specified as props.children
.
f
is a function of up to 3 args:
child
: the child elementkey
: the React key assigned to this elementindex
: the numeric index of the element in the child collection starting at 0If children is an array it will be traversed and the function will be called for each child in the array.
If children is null or undefined, this function will return null or undefined rather than an array.
Map children that are typically specified as `props.children`. `f` is a function of up to 3 args: - `child`: the child element - `key`: the React key assigned to this element - `index`: the numeric index of the element in the child collection starting at 0 If children is an array it will be traversed and the function will be called for each child in the array. If children is null or undefined, this function will return null or undefined rather than an array.
(only children)
Verifies that children has only one child (a React element) and returns it. Otherwise this method throws an error.
Verifies that children has only one child (a React element) and returns it. Otherwise this method throws an error.
(vec children)
Returns the children opaque data structure as a flat vector with keys assigned to each child. Useful if you want to manipulate collections of children in render, especially if you want to reorder or slice (:children props) before passing it down.
Returns the children opaque data structure as a flat vector with keys assigned to each child. Useful if you want to manipulate collections of children in render, especially if you want to reorder or slice (:children props) before passing it down.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close