Browse Source

Fix crashing when adding a frontend component after deleting one

pull/4023/head
Andrew Kingston 6 years ago
parent
commit
42f4bcc339
  1. 5
      packages/builder/src/builderStore/store/index.js

5
packages/builder/src/builderStore/store/index.js

@ -292,6 +292,11 @@ const addChildComponent = store => (componentToAdd, presetProps = {}) => {
? state.currentComponentInfo
: getParent(state.currentPreviewItem.props, state.currentComponentInfo)
// Don't continue if there's no parent
if (!targetParent) {
return state
}
targetParent._children = targetParent._children.concat(newComponent.props)
state.currentFrontEndType === "page"

Loading…
Cancel
Save