Skip to content

Commit

Permalink
Early return was wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
gbalint committed Jul 15, 2024
1 parent 247d8b9 commit 81de9c0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ function isRenderProp(prop: any): prop is { props: { [UTOPIA_PATH_KEY]: string }
}

function areElementsInChildrenOrPropsTree(elementPaths: Array<string>, props: any): boolean {
if (props.children == null || typeof props.children === 'string') {
return false
}

const childrenArr = fastReactChildrenToArray(props.children)

for (let c of childrenArr) {
Expand Down Expand Up @@ -420,6 +416,9 @@ function areElementsInChildrenOrPropsTree(elementPaths: Array<string>, props: an
}

function fastReactChildrenToArray(children: any) {
if (children == null || typeof children === 'string') {
return []
}
if (React.isValidElement(children)) {
return [children]
}
Expand Down

0 comments on commit 81de9c0

Please sign in to comment.