Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

101
Views
Can't call setState on a component that is not yet mounted. React fullcalendar events

EDIT It turns out that my api return json (I was using jsonify) with date format Thu, 27 Apr 2017 00:00:00 GMT, but Fullcalendar event model does accept it. So I change date to text in my serializer.

I want to add events to my fullcalendar, but I get error below and none of the events appear.

Can't call setState on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to this.state directly or define a state = {}; class property with the desired state in the CalendarDataProvider component.

I tried using useState(), found out that when I create this constructor below and modify events in Fullcalendar component to events={[{title:this.state.title,start:this.state.start,end:this.state.end}]} the calendar will show my event

constructor(props){
    super(props);
    this.state = {
      title: "1",
      start: "2022-05-16",
      end: "2022-05-17",
  }}

This is my code:

export class MakeAppointmentPage extends React.Component {
render() {
    return (
      <FullCalendar
        plugins={[ dayGridPlugin, interactionPlugin ]}
        dateClick={this.handleDateClick}
        locale={'pl'}  
        events={'/umow-wizyte2'}
        weekends={false}
        selectable={true}
        validRange={{ start: new Date(),
          end: '2025-06-01'
         }}
        //allDay={true}
      />      
    )
  }}

URL /umow-wizyte2 returns json like this:

 {
    "title": "Ceramics",
    "id": "821",
    "start": "2012-05-16 09:00:00",
    "end": "2012-05-16 10:30:00"
    }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!