Skip to content

Commit ea80323

Browse files
authored
Merge pull request #5 from birkir/patch-1
Passing options to recursive function
2 parents ee15059 + 852f349 commit ea80323

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ export default function reactTreeWalker(element, visitor, context, options = def
7272
// If its a react Children collection we need to breadth-first
7373
// traverse each of them.
7474
const mapper = aChild =>
75-
aChild ? reactTreeWalker(aChild, visitor, theChildContext) : undefined
75+
aChild ? reactTreeWalker(aChild, visitor, theChildContext, options) : undefined
7676
// pMapSeries allows us to do depth-first traversal. Thanks @sindresorhus!
7777
pMapSeries(Children.map(child, cur => cur), mapper).then(resolve)
7878
} else {
7979
// Otherwise we pass the individual child to the next recursion.
80-
reactTreeWalker(child, visitor, theChildContext).then(resolve)
80+
reactTreeWalker(child, visitor, theChildContext, options).then(resolve)
8181
}
8282
}
8383

0 commit comments

Comments
 (0)