Skip to content

Commit 7b5a6a7

Browse files
authored
fix: prefix React lifecycle methods with UNSAFE (jquense#1578)
1 parent f1c55d1 commit 7b5a6a7

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/BackgroundCells.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class BackgroundCells extends React.Component {
2525
this._teardownSelectable()
2626
}
2727

28-
componentWillReceiveProps(nextProps) {
28+
UNSAFE_componentWillReceiveProps(nextProps) {
2929
if (nextProps.selectable && !this.props.selectable) this._selectable()
3030

3131
if (!nextProps.selectable && this.props.selectable)

src/Calendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ class Calendar extends React.Component {
761761
context: this.getContext(this.props),
762762
}
763763
}
764-
componentWillReceiveProps(nextProps) {
764+
UNSAFE_componentWillReceiveProps(nextProps) {
765765
this.setState({ context: this.getContext(nextProps) })
766766
}
767767

src/DayColumn.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DayColumn extends React.Component {
3737
this.clearTimeIndicatorInterval()
3838
}
3939

40-
componentWillReceiveProps(nextProps) {
40+
UNSAFE_componentWillReceiveProps(nextProps) {
4141
if (nextProps.selectable && !this.props.selectable) this._selectable()
4242
if (!nextProps.selectable && this.props.selectable)
4343
this._teardownSelectable()

src/Month.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MonthView extends React.Component {
3535
}
3636
}
3737

38-
componentWillReceiveProps({ date }) {
38+
UNSAFE_componentWillReceiveProps({ date }) {
3939
this.setState({
4040
needLimitMeasure: !dates.eq(date, this.props.date, 'month'),
4141
})

src/TimeGrid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class TimeGrid extends Component {
2727
this._scrollRatio = null
2828
}
2929

30-
componentWillMount() {
30+
UNSAFE_componentWillMount() {
3131
this.calculateScroll()
3232
}
3333

@@ -73,7 +73,7 @@ export default class TimeGrid extends Component {
7373
//this.checkOverflow()
7474
}
7575

76-
componentWillReceiveProps(nextProps) {
76+
UNSAFE_componentWillReceiveProps(nextProps) {
7777
const { range, scrollToTime } = this.props
7878
// When paginating, reset scroll
7979
if (

src/TimeGutter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class TimeGutter extends Component {
1818
})
1919
}
2020

21-
componentWillReceiveProps(nextProps) {
21+
UNSAFE_componentWillReceiveProps(nextProps) {
2222
const { min, max, timeslots, step } = nextProps
2323
this.slotMetrics = this.slotMetrics.update({ min, max, timeslots, step })
2424
}

0 commit comments

Comments
 (0)