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

163
Vistas
passing props for components to useMemo getting undefine

I am passing data in the MemoDownloadsSubTab component but when I am trying to use it in MemoDownloadsSubTab in useMemo I am getting error data that is not defined I am not sure why this is happening let me know what I need to change so any another way I need to pass data in parent to child and us in the child component.

export const CorporateDetailsTable = ({
    userHistorySummary,
  }) => {
  
    const MemoDownloadsSubTab = React.useMemo(
      ({ data = [] }) => {
        return (
          <>
            {data?.length !== 0 &&
              data?.map((row, rowIndex) => {
                return (
                  <Box bgcolor="mainDetailsCard.primary" m={1} p={1} borderRadius={5}>
                    <Grid xs={12} item container spacing={2}>
                      <Grid item xs={12} sm={3}>
                        <Typography component="div">
                          <Box fontWeight="fontWeightBold" component="span" mr={1}>
                            SRN :
                          </Box>
                          {row.SRN}
                        </Typography>
                      </Grid>
                      <Grid item xs={12} sm={3}>
                        <Typography component="div">
                          <Box fontWeight="fontWeightBold" component="span" mr={1}>
                            Charge ID :
                          </Box>
                          {row.CHARGE_ID ? row.CHARGE_ID : "N/A"}
                        </Typography>
                      </Grid>
                    </Grid>
                  </Box>
                );
              })}
          </>
        );
      }
      ,[userHistorySummary?.charges]);
    return (
      <>
        {userHistorySummary?.masterData?.length !== 0 ? (
          <Box mt={1}>
                return (
                          <MemoDownloadsSubTab
                            data={userHistorySummary?.charges}
                            title={"Charges Registered"}
                            cells={chargesCells}
                            classes={classes}
                          />
          </Box>
        ) : (
          <Typography variant="subtitle1" color="textSecondary">
            No Data Available
          </Typography>
        )}
      </>
    );
  };
about 4 years 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 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