I’m using fullcalendar react and want to customize the way events are displayed on the weekly calendar view. Even if my eventContent is just a basic one like returning the title, it causes a re-render of the events everytime I navigate to prev/next week. If I don’t use the eventContent option, it renders only once. I’m using thousands of events(earnings dates and info of companies in stock market) on the calendar. Is there anyway to find out how to not trigger the re-render?
The events are given to the FullCalendar as a callback function. The function takes the start and end dates of the current view using fetchEvents info and the data is returned from reading a json file using success callback.
const eventContent = (eventInfo) => {
const {event} = eventInfo;
return (<span>{event.title}</span>)
}
<FullCalendar
plugins={[dayGridPlugin]}
initialView="dayGridWeek"
weekends={true}
events={events}
eventDisplay="block"
eventOrder="start, title"
timeZone="local"
eventContent={eventContent}
headerToolbar={{
start: "prev",
center: "title",
end: "next",
}}
allDaySlot={false}
/>
)}
</>
I tried to set my custom view for events, like having the company name(set in extendedProps of event), start time, ticker symbol of the company(set as event title) and expecting to render once.