Skip to content

Commit 7aab5a0

Browse files
committed
resolve more React type compatibility issues
1 parent a407271 commit 7aab5a0

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

lib/components/event-schedule-new/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from "react";
1+
import React, { useEffect, useState, Suspense } from "react";
22
import moment from "moment";
33
// import NewSchedule from './calendar'
44
import Event from "./event/event";
@@ -148,7 +148,7 @@ const computeEventPlacements = (
148148
return eventPlacements;
149149
};
150150

151-
const NewScheduleIndex = ({
151+
const NewScheduleIndexInner = ({
152152
selectedEvent,
153153
selectedDay,
154154
setSelectedEvent,
@@ -364,4 +364,12 @@ const NewScheduleIndex = ({
364364
</div> */
365365
};
366366

367+
const NewScheduleIndex = (props: ScheduleProps) => {
368+
return (
369+
<Suspense fallback={<div>Loading...</div>}>
370+
<NewScheduleIndexInner {...props} />
371+
</Suspense>
372+
);
373+
};
374+
367375
export default NewScheduleIndex;

lib/components/event-schedule/EventSchedule.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextPage } from "next";
22
import Image from "next/image";
3-
import React, { useEffect } from "react";
3+
import React, { useEffect, Suspense } from "react";
44
import css from "./event-schedule.module.scss";
55
import moment from "moment";
66
import momentTZ from "moment-timezone";
@@ -2091,7 +2091,7 @@ const scheduleViewHOC = (Component: any) => {
20912091
return ComponentWithScheduleView;
20922092
};
20932093

2094-
const Schedule: NextPage = scheduleViewHOC((props: any) => {
2094+
const ScheduleInner: NextPage = scheduleViewHOC((props: any) => {
20952095
const [openShareModal, setOpenShareModal] = React.useState(false);
20962096
const [calendarModalOpen, setCalendarModalOpen] = React.useState(false);
20972097
const { scheduleView, setScheduleView } = props;
@@ -2611,6 +2611,14 @@ const Schedule: NextPage = scheduleViewHOC((props: any) => {
26112611
);
26122612
});
26132613

2614+
const Schedule: NextPage = (props: any) => {
2615+
return (
2616+
<Suspense fallback={<div>Loading...</div>}>
2617+
<ScheduleInner {...props} />
2618+
</Suspense>
2619+
);
2620+
};
2621+
26142622
export default Schedule;
26152623

26162624
type Edition = "istanbul" | "amsterdam";

0 commit comments

Comments
 (0)