Skip to content

Commit 7b5f5b8

Browse files
authored
fix: do not send undefined/null gutterRef to getWidth (jquense#2300)
1 parent 2a1d5b5 commit 7b5f5b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/TimeGrid.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ export default class TimeGrid extends Component {
267267
}
268268
this.measureGutterAnimationFrameRequest = window.requestAnimationFrame(
269269
() => {
270-
const width = getWidth(this.gutterRef?.current)
270+
const width = this.gutterRef?.current
271+
? getWidth(this.gutterRef.current)
272+
: undefined
271273

272274
if (width && this.state.gutterWidth !== width) {
273275
this.setState({ gutterWidth: width })

0 commit comments

Comments
 (0)