[Ivan Diaz] - Update react-dfs
This commit is contained in:
parent
23a3089825
commit
08d6441bff
|
@ -37,7 +37,7 @@
|
||||||
"gulp-imagemin": "^2.3.0",
|
"gulp-imagemin": "^2.3.0",
|
||||||
"gulp-notify": "^2.2.0",
|
"gulp-notify": "^2.2.0",
|
||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-sass": "^2.0.x",
|
"gulp-sass": "^2.0.4",
|
||||||
"gulp-sass-bulk-import": "^0.3.2",
|
"gulp-sass-bulk-import": "^0.3.2",
|
||||||
"gulp-sourcemaps": "^1.5.2",
|
"gulp-sourcemaps": "^1.5.2",
|
||||||
"gulp-streamify": "0.0.5",
|
"gulp-streamify": "0.0.5",
|
||||||
|
|
|
@ -10,7 +10,10 @@ var reactDFS = function (children, visitFunction) {
|
||||||
while(stack.length) {
|
while(stack.length) {
|
||||||
let element = stack.pop();
|
let element = stack.pop();
|
||||||
let tempChilds = [];
|
let tempChilds = [];
|
||||||
|
|
||||||
|
if(element.props && element.props.children) {
|
||||||
React.Children.forEach(element.props.children, child => tempChilds.push(child));
|
React.Children.forEach(element.props.children, child => tempChilds.push(child));
|
||||||
|
}
|
||||||
|
|
||||||
visitFunction(element);
|
visitFunction(element);
|
||||||
stack = stack.concat(tempChilds.reverse());
|
stack = stack.concat(tempChilds.reverse());
|
||||||
|
|
Loading…
Reference in New Issue