From 7b5a6a79c43591014fa7e009b8b3f00b4f74c7c9 Mon Sep 17 00:00:00 2001
From: Zach <zsiglin@gmail.com>
Date: Wed, 29 Jan 2020 11:24:55 -0700
Subject: [PATCH] fix: prefix React lifecycle methods with UNSAFE (#1578)

---
 src/BackgroundCells.js | 2 +-
 src/Calendar.js        | 2 +-
 src/DayColumn.js       | 2 +-
 src/Month.js           | 2 +-
 src/TimeGrid.js        | 4 ++--
 src/TimeGutter.js      | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/BackgroundCells.js b/src/BackgroundCells.js
index 83bdf1ec3..31e44a22b 100644
--- a/src/BackgroundCells.js
+++ b/src/BackgroundCells.js
@@ -25,7 +25,7 @@ class BackgroundCells extends React.Component {
     this._teardownSelectable()
   }
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     if (nextProps.selectable && !this.props.selectable) this._selectable()
 
     if (!nextProps.selectable && this.props.selectable)
diff --git a/src/Calendar.js b/src/Calendar.js
index 1225925f4..8d64e2655 100644
--- a/src/Calendar.js
+++ b/src/Calendar.js
@@ -761,7 +761,7 @@ class Calendar extends React.Component {
       context: this.getContext(this.props),
     }
   }
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     this.setState({ context: this.getContext(nextProps) })
   }
 
diff --git a/src/DayColumn.js b/src/DayColumn.js
index 0e508f2a8..8474a0eda 100644
--- a/src/DayColumn.js
+++ b/src/DayColumn.js
@@ -37,7 +37,7 @@ class DayColumn extends React.Component {
     this.clearTimeIndicatorInterval()
   }
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     if (nextProps.selectable && !this.props.selectable) this._selectable()
     if (!nextProps.selectable && this.props.selectable)
       this._teardownSelectable()
diff --git a/src/Month.js b/src/Month.js
index 345905955..eb8cb769f 100644
--- a/src/Month.js
+++ b/src/Month.js
@@ -35,7 +35,7 @@ class MonthView extends React.Component {
     }
   }
 
-  componentWillReceiveProps({ date }) {
+  UNSAFE_componentWillReceiveProps({ date }) {
     this.setState({
       needLimitMeasure: !dates.eq(date, this.props.date, 'month'),
     })
diff --git a/src/TimeGrid.js b/src/TimeGrid.js
index 4b96af890..683907084 100644
--- a/src/TimeGrid.js
+++ b/src/TimeGrid.js
@@ -27,7 +27,7 @@ export default class TimeGrid extends Component {
     this._scrollRatio = null
   }
 
-  componentWillMount() {
+  UNSAFE_componentWillMount() {
     this.calculateScroll()
   }
 
@@ -73,7 +73,7 @@ export default class TimeGrid extends Component {
     //this.checkOverflow()
   }
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     const { range, scrollToTime } = this.props
     // When paginating, reset scroll
     if (
diff --git a/src/TimeGutter.js b/src/TimeGutter.js
index c263b6f58..8c3118e88 100644
--- a/src/TimeGutter.js
+++ b/src/TimeGutter.js
@@ -18,7 +18,7 @@ export default class TimeGutter extends Component {
     })
   }
 
-  componentWillReceiveProps(nextProps) {
+  UNSAFE_componentWillReceiveProps(nextProps) {
     const { min, max, timeslots, step } = nextProps
     this.slotMetrics = this.slotMetrics.update({ min, max, timeslots, step })
   }