Chore: full react hooks eslint compliance (#7040)

This commit is contained in:
shamoon
2026-08-21 14:00:02 -07:00
committed by GitHub
parent 7c26cf6d97
commit 4c361422ca
111 changed files with 1072 additions and 867 deletions
+4 -4
View File
@@ -38,16 +38,16 @@ const colorVariants = {
export default function Component({ service }) {
const { widget } = service;
const { i18n } = useTranslation();
const [showDate, setShowDate] = useState(null);
const [events, setEvents] = useState({});
const nowDate = DateTime.now().setLocale(i18n.language);
const currentDate = widget?.timezone ? nowDate.setZone(widget?.timezone).startOf("day") : nowDate;
const [showDate, setShowDate] = useState(null);
const { settings } = useContext(SettingsContext);
useEffect(() => {
if (!showDate) {
setShowDate(currentDate);
}
// seeded after mount, not during render: "today" is client-only and would break hydration
// eslint-disable-next-line react-hooks/set-state-in-effect
if (!showDate) setShowDate(currentDate);
}, [showDate, currentDate]);
// params for API fetch