Skip to content

Commit 126d4ee

Browse files
committed
chore(calendar-web): fix lint warnings
1 parent a61772b commit 126d4ee

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

packages/pluggableWidgets/calendar-web/src/Calendar.editorPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import classnames from "classnames";
22
import { ReactElement } from "react";
33
import { Calendar, dateFnsLocalizer, EventPropGetter } from "react-big-calendar";
44
import { CalendarPreviewProps } from "../typings/CalendarProps";
5-
import { CustomToolbar, createConfigurableToolbar } from "./components/Toolbar";
6-
import { constructWrapperStyle, WrapperStyleProps } from "./utils/style-utils";
5+
import { createConfigurableToolbar, CustomToolbar } from "./components/Toolbar";
76
import { eventPropGetter, format, getDay, parse, startOfWeek } from "./utils/calendar-utils";
7+
import { constructWrapperStyle, WrapperStyleProps } from "./utils/style-utils";
88

99
import "react-big-calendar/lib/css/react-big-calendar.css";
1010
import "./ui/Calendar.scss";

packages/pluggableWidgets/calendar-web/src/Calendar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import "./ui/Calendar.scss";
88
import { useCalendarEvents } from "./helpers/useCalendarEvents";
99

1010
export default function MxCalendar(props: CalendarContainerProps): ReactElement {
11+
// useMemo with empty dependency array is used
12+
// because style and calendar controller needs to be created only once
13+
// and not on every re-render
14+
// eslint-disable-next-line react-hooks/exhaustive-deps
1115
const wrapperStyle = useMemo(() => constructWrapperStyle(props), []);
16+
// eslint-disable-next-line react-hooks/exhaustive-deps
1217
const calendarController = useMemo(() => new CalendarPropsBuilder(props), []);
1318
const calendarProps = useMemo(() => {
1419
calendarController.updateProps(props);

packages/pluggableWidgets/calendar-web/src/helpers/CalendarPropsBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ObjectItem } from "mendix";
22
import { DateLocalizer, Formats, ViewsProps } from "react-big-calendar";
33
import { CalendarContainerProps } from "../../typings/CalendarProps";
4-
import { CustomToolbar, ResolvedToolbarItem, createConfigurableToolbar } from "../components/Toolbar";
4+
import { createConfigurableToolbar, CustomToolbar, ResolvedToolbarItem } from "../components/Toolbar";
55
import { eventPropGetter, localizer } from "../utils/calendar-utils";
66
import { CalendarEvent, DragAndDropCalendarProps } from "../utils/typings";
77
import { CustomWeekController } from "./CustomWeekController";

0 commit comments

Comments
 (0)