|
|
@@ -14,6 +14,7 @@ import { PanelEditor } from '../panel_editor/PanelEditor';
|
|
|
import { PanelModel, DashboardModel } from '../state';
|
|
|
import { PanelPlugin } from 'app/types';
|
|
|
import { PanelResizer } from './PanelResizer';
|
|
|
+import { PanelTypeChangedHook } from '@grafana/ui';
|
|
|
|
|
|
export interface Props {
|
|
|
panel: PanelModel;
|
|
|
@@ -91,8 +92,11 @@ export class DashboardPanel extends PureComponent<Props, State> {
|
|
|
|
|
|
this.props.panel.changeType(pluginId);
|
|
|
} else {
|
|
|
- const { reactPanel } = plugin.exports;
|
|
|
- panel.changeType(pluginId, reactPanel.panelTypeChangedHook);
|
|
|
+ let hook: PanelTypeChangedHook | null = null;
|
|
|
+ if (plugin.exports.reactPanel) {
|
|
|
+ hook = plugin.exports.reactPanel.panelTypeChangedHook;
|
|
|
+ }
|
|
|
+ panel.changeType(pluginId, hook);
|
|
|
}
|
|
|
}
|
|
|
|