[Ivan Diaz] - Update react-dfs

This commit is contained in:
Ivan Diaz 2015-10-14 19:35:32 -03:00
parent 23a3089825
commit 08d6441bff
2 changed files with 5 additions and 2 deletions

View File

@ -37,7 +37,7 @@
"gulp-imagemin": "^2.3.0",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.x",
"gulp-sass": "^2.0.4",
"gulp-sass-bulk-import": "^0.3.2",
"gulp-sourcemaps": "^1.5.2",
"gulp-streamify": "0.0.5",

View File

@ -10,7 +10,10 @@ var reactDFS = function (children, visitFunction) {
while(stack.length) {
let element = stack.pop();
let tempChilds = [];
React.Children.forEach(element.props.children, child => tempChilds.push(child));
if(element.props && element.props.children) {
React.Children.forEach(element.props.children, child => tempChilds.push(child));
}
visitFunction(element);
stack = stack.concat(tempChilds.reverse());