Liking cljdoc? Tell your friends :D
ClojureScript only.

helix.children


childrencljs

(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.
sourceraw docstring

countcljs

(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.
sourceraw docstring

mapcljs

(map f children)

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.

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.
sourceraw docstring

onlycljs

(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.
sourceraw docstring

veccljs

(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.
sourceraw docstring

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

× close