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.
Item Index
Methods
getChildrenList
-
component
Returns the child of the specified component
Parameters:
-
component
ObjectThe current component
Returns:
object The child of the specified component
getDescendantsList
-
component
Returns all children of the specified component
Parameters:
-
component
ObjectThe current component
Returns:
descendantsList The list of children of the specified component
mapDescendants
-
component
-
fn
Returns all children of the specified component and execute the specified function
Parameters:
-
component
ObjectThe current component
-
fn
FunctionThe function to execute
Returns:
object The list of children of the specified component
mapTree
-
component
-
fn
Compute all children of the specified component and execute the function
Parameters:
-
component
ObjectThe current component
-
fn
FunctionThe function to execute
Returns:
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
Function to use if you want convert all the descendants of the component using a specified function
Parameters:
-
component
ObjectThe current component
-
fn
FunctionThe function to execute
Returns:
component The computed component
transformTree
-
component
-
fn
Convert all the current descendant of the component using a specified function
Parameters:
-
component
ObjectThe current component
-
fn
FunctionThe function to execute
Returns:
object Call the transformDescendants function in order to convert the subdescendant of the current component