From 0b35818aef7c060827356b7b779906b16f71d9cd Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Wed, 9 Nov 2022 18:51:43 -0800 Subject: [PATCH] fix: do not send undefined/null gutterRef to getWidth --- src/TimeGrid.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TimeGrid.js b/src/TimeGrid.js index dd5b46f98..197037a1e 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -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 })