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

273
Visualizações
Uncaught TypeError: Cannot read properties of undefined (reading 'start_time')

I am facing this error when I update my last end time of last interval although it updates my state but not showing it in table

enter image description here

 const onEdit = (oldValue, newValue, row, column) => {
    const oldRows = props.row;
    console.log("BHai", props.row.length - 1);
    if (column.dataField === "end_time") {
      if (newValue < oldRows[row.interval + 1].start_time) {
        oldRows[row.interval][column.dataField] = newValue;
        const startTime = parseInt(row.start_time);
        const endTime = parseInt(row.end_time);
        props.onIntervalUpdate([startTime, endTime], row.interval);
        console.log("BHai1");
      } else if (oldRows[row.interval].interval === props.row.length - 1) {
        oldRows[row.interval][column.dataField] = newValue;
        const startTime = parseInt(row.start_time);
        const endTime = parseInt(row.end_time);
        props.onIntervalUpdate([startTime, endTime], row.interval);
        console.log("BHai2");
      } else {
        oldRows[row.interval][column.dataField] = oldValue;
        const startTime = parseInt(row.start_time);
        const endTime = parseInt(row.end_time);
        props.onIntervalUpdate([startTime, endTime], row.interval);
        console.log("BHai3");
      }
    }

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Consider adding Optional chaining (?.) during destructuring, as:

newValue < oldRows[row.interval + 1]?.start_time)

and

 const startTime = parseInt(row?.start_time);
about 4 years ago · Juan Pablo Isaza Relatório

0

figured it out like this,

if (
        oldRows[row.interval].interval === props.row.length - 1 &&
        oldRows[row.interval].start_time
      )

working fine for me

about 4 years ago · Juan Pablo Isaza Relatório
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