Estoy pasando datos en el componente MemoDownloadsSubTab, pero cuando intento usarlos en MemoDownloadsSubTab en useMemo, recibo datos de error que no están definidos. necesita pasar datos de padre a hijo y nosotros en el componente hijo.
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> )} </> ); };