question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maximum update depth exceed with dynamic events and validRange

See original GitHub issue

Bug Reports

If I use datesSet, events and validRange in tandem, I’m getting React’s “Maximum update depth exceeded error”. It works fine without the validRange option. Here’s a minimal example:

https://codesandbox.io/s/react-fullcalendar-maximum-update-depth-exceeded-rtto4?file=/src/Calendar.js

What am I doing wrong? Thanks for any hints!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
soulchildcommented, Sep 18, 2020

I tried that as well. Updated example:

https://codesandbox.io/s/react-fullcalendar-maximum-update-depth-exceeded-rtto4?file=/src/Calendar.js

In my real-world application I need to asynchronously fetch events in the events function and returning a Promise from it (or using the success/error callback) generates another loop where the events function is called indefinitely. This time without the React error, but if you look at the console output, you’ll see that it logs continously.

1reaction
saneq148commented, May 9, 2022

Make sure that your valid range object is the same at each render I took it outside of component, it stopped rerender each time

const calendarRange = {
  dateFrom: startMonth,
  dateTo: endMonth,
};
const Calendar = () => {

  return (
    <div>
      <div>
        <FullCalendar
          plugins={[dayGridPlugin, listPlugin]}
          initialView="dayGridWeek"
          headerToolbar={{
            left: "prev,next",
            center: "title",
            right: "dayGridMonth,dayGridWeek,dayGridDay,listWeek",
          }}
          events={events}
          datesSet={onDatesSet}
          eventClick={onEventClick}
          validRange={validRange}
          displayEventTime={false}
        />
      </div>
    </div>
  );
};

export default Calendar;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximum update depth exceed with dynamic events ... - GitHub
Bug Reports If I use datesSet, events and validRange in tandem, I'm getting React's "Maximum update depth exceeded error".
Read more >
React: 'Maximum update depth exceeded' with FullCalendar
As it has been said, you are triggering a useEffect with a calendarEvents dependency, which sets the state of the calendar events ( ......
Read more >
@fullcalendar/list | Yarn - Package Manager
A full-sized drag & drop JavaScript event calendar ... fixed: React Strict Mode, dateSet, and "Maximum update depth exceeded error" (#5935, react-185) ...
Read more >
Fix the "Maximum Update Depth Exceeded" Error in React
One of which is when you accidentally cause an infinite render loop, often resulting in the cryptic “maximum update depth exceeded” error.
Read more >
Database Engine events and errors - SQL Server
ls' contains more than the maximum number of prefixes. ... Modify the SET clause to make sure that a column is updated only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found