Browse Source

fix: Remove legacy title-prop and update document.title when navModel is changed #15108

Johannes Schill 7 years ago
parent
commit
7d8607c1b3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      public/app/core/components/Page/Page.tsx

+ 2 - 2
public/app/core/components/Page/Page.tsx

@@ -9,9 +9,9 @@ import PageHeader from '../PageHeader/PageHeader';
 import Footer from '../Footer/Footer';
 import PageContents from './PageContents';
 import { CustomScrollbar } from '@grafana/ui';
+import { isEqual } from 'lodash';
 
 interface Props {
-  title?: string;
   children: JSX.Element[] | JSX.Element;
   navModel: NavModel;
 }
@@ -28,7 +28,7 @@ class Page extends Component<Props> {
   }
 
   componentDidUpdate(prevProps: Props) {
-    if (prevProps.title !== this.props.title) {
+    if (!isEqual(prevProps.navModel, this.props.navModel)) {
       this.updateTitle();
     }
   }