From 7b5f5b8ef438ff469e7d098a6274118149883238 Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Thu, 10 Nov 2022 04:58:59 -0800 Subject: [PATCH] fix: do not send undefined/null gutterRef to getWidth (#2300) --- 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 })