Skip to content

Commit

Permalink
update elements in render props on the canvas (#5672)
Browse files Browse the repository at this point in the history
* update elements in render props on the canvas

* rectify the props
  • Loading branch information
bkrmendy authored May 15, 2024
1 parent 290d2c0 commit 2eeaf0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export function createComponentRendererComponent(params: {
return Component
}

function isRenderProp(prop: any): prop is { [UTOPIA_PATH_KEY]: string; props: MapLike<any> } {
function isRenderProp(prop: any): prop is { props: { [UTOPIA_PATH_KEY]: string } } {
return (
prop != null &&
typeof prop === 'object' &&
Expand All @@ -359,7 +359,7 @@ function isElementInChildrenOrPropsTree(elementPath: string, props: any): boolea
}

const elementsInProps = Object.values(props).filter(isRenderProp)
const isElementInProps = elementsInProps.some((p) => p[UTOPIA_PATH_KEY] === elementPath)
const isElementInProps = elementsInProps.some((p) => p.props[UTOPIA_PATH_KEY] === elementPath)
if (isElementInProps) {
return true
}
Expand Down

0 comments on commit 2eeaf0e

Please sign in to comment.