From dac8c4ad643f92b5243d566761834efe3a05c729 Mon Sep 17 00:00:00 2001 From: Tim Klever Date: Fri, 14 Aug 2020 17:38:33 -0700 Subject: [PATCH] Migrate ArchiveNotifier from UNSAFE_componentWillReceiveProps (#614) Signed-off-by: Tim Klever --- .../src/components/TracePage/ArchiveNotifier/index.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx b/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx index 8df9d7a19e..5fdeab6527 100644 --- a/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/ArchiveNotifier/index.tsx @@ -111,12 +111,9 @@ export default class ArchiveNotifier extends React.PureComponent { this.state = { notifiedState }; } - // eslint-disable-next-line camelcase - UNSAFE_componentWillReceiveProps(nextProps: Props) { - const notifiedState = processProps(this.state.notifiedState, nextProps); - if (this.state.notifiedState !== notifiedState) { - this.setState({ notifiedState }); - } + static getDerivedStateFromProps(props: Props, state: State) { + const notifiedState = processProps(state.notifiedState, props); + return { notifiedState }; } componentWillUnmount() {