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

262
Views
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 answers
Answer question

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 Report

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 Report
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!