Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

95
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda