Browse Source

ref(js): Consistently use UNSAFE_* on deprecated lifecycles (#50587)

Evan Purkhiser 1 year ago
parent
commit
fe0e664fcd

+ 1 - 1
static/app/components/assigneeSelectorDropdown.tsx

@@ -95,7 +95,7 @@ export class AssigneeSelectorDropdown extends Component<
     };
   }
 
-  componentWillReceiveProps(nextProps: AssigneeSelectorDropdownProps) {
+  UNSAFE_componentWillReceiveProps(nextProps: AssigneeSelectorDropdownProps) {
     const loading = GroupStore.hasStatus(nextProps.id, 'assignTo');
     if (nextProps.id !== this.props.id || loading !== this.state.loading) {
       const group = GroupStore.get(this.props.id);

+ 1 - 1
static/app/components/issues/compactIssue.tsx

@@ -95,7 +95,7 @@ class CompactIssue extends Component<Props, State> {
     issue: this.props.data || GroupStore.get(this.props.id),
   };
 
-  componentWillReceiveProps(nextProps: Props) {
+  UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (nextProps.id !== this.props.id) {
       this.setState({
         issue: GroupStore.get(this.props.id),

+ 2 - 2
static/app/components/resultGrid.tsx

@@ -189,11 +189,11 @@ class ResultGrid extends Component<Props, State> {
 
   state: State = this.defaultState;
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     this.fetchData();
   }
 
-  componentWillReceiveProps() {
+  UNSAFE_componentWillReceiveProps() {
     const queryParams = this.query;
     this.setState(
       {

+ 2 - 2
static/app/views/admin/adminOverview/apiChart.tsx

@@ -33,11 +33,11 @@ type State = {
 class ApiChart extends Component<Props, State> {
   state: State = initialState;
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     this.fetchData();
   }
 
-  componentWillReceiveProps(nextProps: Props) {
+  UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (this.props.since !== nextProps.since) {
       this.setState(initialState, this.fetchData);
     }

+ 2 - 2
static/app/views/admin/adminOverview/eventChart.tsx

@@ -36,11 +36,11 @@ const initialState: State = {
 class EventChart extends Component<Props, State> {
   state: State = initialState;
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     this.fetchData();
   }
 
-  componentWillReceiveProps(nextProps: Props) {
+  UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (this.props.since !== nextProps.since) {
       this.setState(initialState, this.fetchData);
     }

+ 1 - 1
static/app/views/alerts/rules/issue/index.tsx

@@ -182,7 +182,7 @@ class IssueRuleEditor extends AsyncView<Props, State> {
     return createFromDuplicate && location?.query.duplicateRuleId;
   }
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     this.fetchPreview();
   }
 

+ 1 - 1
static/app/views/discover/resultsChart.tsx

@@ -196,7 +196,7 @@ class ResultsChartContainer extends Component<ContainerProps, ContainerState> {
     yAxisOptions: this.getYAxisOptions(this.props.eventView),
   };
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     const yAxisOptions = this.getYAxisOptions(this.props.eventView);
     const nextYAxisOptions = this.getYAxisOptions(nextProps.eventView);
 

+ 1 - 1
static/app/views/issueDetails/groupMerged/index.tsx

@@ -42,7 +42,7 @@ class GroupMergedView extends Component<Props, State> {
     this.fetchData();
   }
 
-  componentWillReceiveProps(nextProps: Props) {
+  UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (
       nextProps.params.groupId !== this.props.params.groupId ||
       nextProps.location.search !== this.props.location.search

+ 1 - 1
static/app/views/projects/projectContext.tsx

@@ -91,7 +91,7 @@ class ProjectContext extends Component<Props, State> {
     }
   }
 
-  componentWillReceiveProps(nextProps: Props) {
+  UNSAFE_componentWillReceiveProps(nextProps: Props) {
     if (nextProps.projectId === this.props.projectId) {
       return;
     }

+ 1 - 1
static/app/views/sharedGroupDetails/index.tsx

@@ -51,7 +51,7 @@ class SharedGroupDetails extends Component<Props, State> {
     };
   }
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     document.body.classList.add('shared-group');
   }