Skip to content

Commit

Permalink
fix: revert (jquense#2227)
Browse files Browse the repository at this point in the history
Have to roll back changes until we can refactor as functional component with hooks
  • Loading branch information
cutterbl authored Jul 12, 2022
1 parent 5a77409 commit b81fa14
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ class DayColumn extends React.Component {
this.clearTimeIndicatorInterval()
}

getSnapshotBeforeUpdate(prevProps) {
if (!prevProps.selectable && this.props.selectable) this._selectable()
if (prevProps.selectable && !this.props.selectable)
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.selectable && !this.props.selectable) this._selectable()
if (!nextProps.selectable && this.props.selectable)
this._teardownSelectable()

this.slotMetrics = this.slotMetrics.update(nextProps)
}

componentDidUpdate(prevProps, prevState) {
Expand Down Expand Up @@ -115,7 +117,7 @@ class DayColumn extends React.Component {
components: { eventContainerWrapper: EventContainer, ...components },
} = this.props

let slotMetrics = this?.slotMetrics?.update?.(this.props) ?? {}
let { slotMetrics } = this
let { selecting, top, height, startDate, endDate } = this.state

let selectDates = { start: startDate, end: endDate }
Expand Down

0 comments on commit b81fa14

Please sign in to comment.