Skip to content

Commit

Permalink
fix: do not send undefined/null gutterRef to getWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvgoel92 committed Nov 10, 2022
1 parent 2a1d5b5 commit 0b35818
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TimeGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ export default class TimeGrid extends Component {
}
this.measureGutterAnimationFrameRequest = window.requestAnimationFrame(
() => {
const width = getWidth(this.gutterRef?.current)
const width = this.gutterRef?.current
? getWidth(this.gutterRef.current)
: undefined

if (width && this.state.gutterWidth !== width) {
this.setState({ gutterWidth: width })
Expand Down

0 comments on commit 0b35818

Please sign in to comment.