Skip to content

Commit

Permalink
Passing parent node props to child nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
afresquet committed Oct 1, 2018
1 parent 75ec82a commit b4134e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Recursive.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ class Recursive extends Component {

renderNodes = newProps => {
const { nextIteration, nodes, hasNodes } = this;
const { children, array, nodesName, tree, keyName } = this.props;
const { children, nodesName, tree, keyName } = this.props;
const { [nodesName]: _, ...parentProps } = this.iterationProps;

return !hasNodes
? null
: nodes.map(node => (
<Recursive
array={array}
{...parentProps}
tree={tree}
nodesName={nodesName}
keyName={keyName}
Expand Down

0 comments on commit b4134e7

Please sign in to comment.