[fix] JS error after delete row level tab (#6393)
This commit is contained in:
parent
e66b0469b4
commit
ec1316a5a8
|
|
@ -39,15 +39,17 @@ function mapStateToProps(
|
||||||
|
|
||||||
// rows and columns need more data about their child dimensions
|
// rows and columns need more data about their child dimensions
|
||||||
// doing this allows us to not pass the entire component lookup to all Components
|
// doing this allows us to not pass the entire component lookup to all Components
|
||||||
const componentType = component.type;
|
if (component) {
|
||||||
if (componentType === ROW_TYPE || componentType === COLUMN_TYPE) {
|
const componentType = component.type;
|
||||||
const { occupiedWidth, minimumWidth } = getDetailedComponentWidth({
|
if (componentType === ROW_TYPE || componentType === COLUMN_TYPE) {
|
||||||
id,
|
const { occupiedWidth, minimumWidth } = getDetailedComponentWidth({
|
||||||
components: dashboardLayout,
|
id,
|
||||||
});
|
components: dashboardLayout,
|
||||||
|
});
|
||||||
|
|
||||||
if (componentType === ROW_TYPE) props.occupiedColumnCount = occupiedWidth;
|
if (componentType === ROW_TYPE) props.occupiedColumnCount = occupiedWidth;
|
||||||
if (componentType === COLUMN_TYPE) props.minColumnWidth = minimumWidth;
|
if (componentType === COLUMN_TYPE) props.minColumnWidth = minimumWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return props;
|
return props;
|
||||||
|
|
@ -68,7 +70,7 @@ function mapDispatchToProps(dispatch) {
|
||||||
class DashboardComponent extends React.PureComponent {
|
class DashboardComponent extends React.PureComponent {
|
||||||
render() {
|
render() {
|
||||||
const { component } = this.props;
|
const { component } = this.props;
|
||||||
const Component = ComponentLookup[component.type];
|
const Component = component ? ComponentLookup[component.type] : null;
|
||||||
return Component ? <Component {...this.props} /> : null;
|
return Component ? <Component {...this.props} /> : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue