diff --git a/editor/src/components/navigator/navigator-item/component-picker-context-menu.tsx b/editor/src/components/navigator/navigator-item/component-picker-context-menu.tsx index 809ab19b431c..6b5b3802eb93 100644 --- a/editor/src/components/navigator/navigator-item/component-picker-context-menu.tsx +++ b/editor/src/components/navigator/navigator-item/component-picker-context-menu.tsx @@ -344,7 +344,7 @@ export const useCreateCallbackToShowComponentPicker = // for insertion and replacement we still don't support multiple selection // so we pick the first one targets = selectedViews.slice(0, 1) - const firstTarget = EP.getFirstPath(targets) + const firstTarget = targets[0] const targetParent = isReplaceTarget(insertionTarget) || isReplaceKeepChildrenAndStyleTarget(insertionTarget) @@ -478,7 +478,7 @@ function insertComponentPickerItem( const uid = generateConsistentUID('prop', uniqueIds) const elementWithoutUID = toInsert.element() // TODO: for most of the operations we still only support one target - const firstTarget = EP.getFirstPath(targets) + const firstTarget = targets[0] const actions = ((): Array => { if (elementWithoutUID.type === 'JSX_ELEMENT') { @@ -744,7 +744,7 @@ const ComponentPickerContextMenuSimple = React.memo( ({ targets, insertionTarget }) => { // for insertion we currently only support one target - const firstTarget = EP.getFirstPath(targets) + const firstTarget = targets[0] const targetChildren = useEditorState( Substores.metadata, (store) => MetadataUtils.getChildrenUnordered(store.editor.jsxMetadata, firstTarget),