Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

50
Vistas
Saving description from nested data in React

I'm trying to save all descriptions from a nested data return. I can save the description of a single index on my fetch. When I try to do it anywhere outside of the fetch, I get the error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'c'). C is the final section of the nested results (data[1].c[1].v). I'm not sure exactly what I'm doing wrong. I can pass the info down to the jsx and display it, but I still need to loop through all the descriptions. Any tips would be helpful.

const jsonData = JSON.parse(data.substring(47).slice(0,-2));
      setSpreadsheetData(jsonData.table.rows[1].c[1].v)

This is what returns the single description for the data. The first 1 index is what I need to loop through to get each result. Everything after is the exact path for the description. Any tips in the right direction would be helpful.

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.