From 7d8607c1b3306736319e45d4b9f75b255ab94bf1 Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Tue, 29 Jan 2019 17:03:40 +0100 Subject: [PATCH] fix: Remove legacy title-prop and update document.title when navModel is changed #15108 --- public/app/core/components/Page/Page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/core/components/Page/Page.tsx b/public/app/core/components/Page/Page.tsx index 8c9a5595cb7..c4846ecf85d 100644 --- a/public/app/core/components/Page/Page.tsx +++ b/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 { } componentDidUpdate(prevProps: Props) { - if (prevProps.title !== this.props.title) { + if (!isEqual(prevProps.navModel, this.props.navModel)) { this.updateTitle(); } }