From fe44bc989a8e9e8f5d1920b575dd3c10afe84ff1 Mon Sep 17 00:00:00 2001 From: Yashaswee Kesharwani Date: Wed, 16 Jul 2025 00:59:22 +0530 Subject: [PATCH] fix: use-memo dependency array and prop-types error --- client/src/Components/Inputs/Search/index.jsx | 3 ++- client/src/Pages/Settings/SettingsTimeZone.jsx | 2 +- .../src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/Components/Inputs/Search/index.jsx b/client/src/Components/Inputs/Search/index.jsx index f536bd5b5..23318c503 100644 --- a/client/src/Components/Inputs/Search/index.jsx +++ b/client/src/Components/Inputs/Search/index.jsx @@ -288,7 +288,7 @@ Search.propTypes = { options: PropTypes.array.isRequired, filteredBy: PropTypes.string.isRequired, secondaryLabel: PropTypes.string, - value: PropTypes.array, + value: PropTypes.oneOfType([PropTypes.array, PropTypes.object]), inputValue: PropTypes.string.isRequired, handleInputChange: PropTypes.func.isRequired, handleChange: PropTypes.func, @@ -299,6 +299,7 @@ Search.propTypes = { startAdornment: PropTypes.object, endAdornment: PropTypes.object, onBlur: PropTypes.func, + unit: PropTypes.string, }; export default Search; diff --git a/client/src/Pages/Settings/SettingsTimeZone.jsx b/client/src/Pages/Settings/SettingsTimeZone.jsx index 4b17f3f81..be255ab52 100644 --- a/client/src/Pages/Settings/SettingsTimeZone.jsx +++ b/client/src/Pages/Settings/SettingsTimeZone.jsx @@ -17,7 +17,7 @@ const SettingsTimeZone = ({ HEADING_SX, handleChange, timezone }) => { const selectedTimezone = useMemo( () => timezones.find((tz) => tz._id === timezone) ?? null, - [timezone, timezones] + [timezone] ); const handleTimezoneChange = useCallback( diff --git a/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx b/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx index 0bc6426bc..4c2842b71 100644 --- a/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx +++ b/client/src/Pages/StatusPage/Create/Components/Tabs/Settings.jsx @@ -33,7 +33,7 @@ const TabSettings = ({ const selectedTimezone = useMemo( () => timezones.find((tz) => tz._id === form.timezone) ?? null, - [form.timezone, timezones] + [form.timezone] ); const handleTimezoneChange = useCallback(