API Docs for: 0.2.2
Show:

R.ReactChildren Class

Method definitions that complements React.Children.
Used to navigate through all children of a specific component in order to calculate its descendants.

Methods

getChildrenList

(
  • component
)
Object

Returns the child of the specified component

Parameters:

  • component Object

    The current component

Returns:

Object:

object The child of the specified component

getDescendantsList

(
  • component
)
Object

Returns all children of the specified component

Parameters:

  • component Object

    The current component

Returns:

Object:

descendantsList The list of children of the specified component

mapDescendants

(
  • component
  • fn
)
Object

Returns all children of the specified component and execute the specified function

Parameters:

  • component Object

    The current component

  • fn Function

    The function to execute

Returns:

Object:

object The list of children of the specified component

mapTree

(
  • component
  • fn
)
Object

Compute all children of the specified component and execute the function

Parameters:

  • component Object

    The current component

  • fn Function

    The function to execute

Returns:

Object:

object The list of children without the component and call fn for each of them

restoreVanillaChildren

()

Function to use if you want restore native function of React.Children

transformDescendants

(
  • component
  • fn
)
Object

Function to use if you want convert all the descendants of the component using a specified function

Parameters:

  • component Object

    The current component

  • fn Function

    The function to execute

Returns:

Object:

component The computed component

transformTree

(
  • component
  • fn
)
Object

Convert all the current descendant of the component using a specified function

Parameters:

  • component Object

    The current component

  • fn Function

    The function to execute

Returns:

Object:

object Call the transformDescendants function in order to convert the subdescendant of the current component