Browse Source

ref(js): Remove unnecessary UNSAFE_* (#50088)

Evan Purkhiser 1 year ago
parent
commit
0219e5b421
1 changed files with 11 additions and 11 deletions
  1. 11 11
      static/app/views/issueDetails/groupEvents.tsx

+ 11 - 11
static/app/views/issueDetails/groupEvents.tsx

@@ -44,6 +44,16 @@ class GroupEvents extends Component<Props, State> {
     };
   }
 
+  componentDidMount() {
+    this._unsubscribeHandleRouteLeave = browserHistory.listen(newLocation =>
+      handleRouteLeave({
+        fieldsToClean: ['cursor'],
+        newLocation,
+        oldPathname: this.props.location.pathname,
+      })
+    );
+  }
+
   UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (this.props.location.search !== nextProps.location.search) {
       const queryParams = nextProps.location.query;
@@ -54,17 +64,7 @@ class GroupEvents extends Component<Props, State> {
     }
   }
 
-  UNSAFE_componentDidMount() {
-    this._unsubscribeHandleRouteLeave = browserHistory.listen(newLocation =>
-      handleRouteLeave({
-        fieldsToClean: ['cursor'],
-        newLocation,
-        oldPathname: this.props.location.pathname,
-      })
-    );
-  }
-
-  UNSAFE_componentWillUnmount() {
+  componentWillUnmount() {
     this._unsubscribeHandleRouteLeave?.();
   }