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

109
Vistas
ypeError: Cannot read properties of undefined (reading 'map')

im done it exactly like in the tutorial and mine is not working, i cant guess why, thanks for any help


import React from "react";
import Day from './Day';

function Month({ month }) {
    return (
        <div className="flex-1 grid grid-cols-7 grid-rows-5">
            {month.map((row, i) => (
                <React.Fragment key={i}>
                    {row.map((day, idx) => (
                        <Day day={day} key={idx} />
                    ))}
                </React.Fragment>
            ))}
        </div>
    )
}

export default Month;
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The month or the row object are undefined in your code try optional chaining to make sure that your objects are not undefined or null.

import React from "react";
import Day from './Day';

function Month({ month }) {
    return (
        <div className="flex-1 grid grid-cols-7 grid-rows-5">
            {month?.map((row, i) => (
                <React.Fragment key={i}>
                    {row?.map((day, idx) => (
                        <Day day={day} key={idx} />
                    ))}
                </React.Fragment>
            ))}
        </div>
    )
}

export default Month;
about 4 years ago · Juan Pablo Isaza Denunciar

0

You are probably mapping something that is not an array Be sure what you pass and read this page (https://www.w3schools.com/jsref/jsref_map.asp)

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