Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

103
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda