From bed6268ba92312f2020dd568beb3d04f03c50f8a Mon Sep 17 00:00:00 2001 From: saeed Date: Tue, 5 Jul 2022 16:43:31 +0430 Subject: [PATCH] Update Calendar.js --- src/Calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Calendar.js b/src/Calendar.js index 96935692..58d06f60 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -44,7 +44,7 @@ const Calendar = ({ }; calendarElement.current.addEventListener('keyup', handleKeyUp, false); return () => { - calendarElement.current.removeEventListener('keyup', handleKeyUp, false); + calendarElement.current && calendarElement.current.removeEventListener('keyup', handleKeyUp, false); }; });