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