infinite loop MenuItem MUI fixed onClick event

89

<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>
<MenuItem onClick={() => handleDelete(post._id, auth.token)}>
   <ListItemIcon>
     <DeleteIcon fontSize='small' />
   </ListItemIcon>
   <ListItemText>Delete</ListItemText>
 </MenuItem>

Comments

Submit
0 Comments