فهرست منبع

wip: panel-header: Change DashboardPanel to a PureComponent to avoid unwanted rerenders

Johannes Schill 7 سال پیش
والد
کامیت
79da3dc9f6
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      public/app/features/dashboard/dashgrid/DashboardPanel.tsx

+ 2 - 2
public/app/features/dashboard/dashgrid/DashboardPanel.tsx

@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { PureComponent } from 'react';
 import config from 'app/core/config';
 import { PanelModel } from '../panel_model';
 import { DashboardModel } from '../dashboard_model';
@@ -20,7 +20,7 @@ export interface State {
   pluginExports: PluginExports;
 }
 
-export class DashboardPanel extends React.Component<Props, State> {
+export class DashboardPanel extends PureComponent<Props, State> {
   element: any;
   angularPanel: AngularComponent;
   pluginInfo: any;