skip to Main Content

Javascript – i set the key in the map but unique key error still exist

<MenuList width={'148px'} > { Object.entries(userRoleMenu[UserRole]).map((item, index) => <> {item[0]==='fpv? <MenuItem _hover={{backgroundColor:'gray.50'}} key={item[0]} onClick={handleMenuClick(item)}> </MenuItem> : <MenuItem _hover={{backgroundColor:'gray.50'}} key={item[0]} onClick={handleMenuClick(item)}>{item[0]}</MenuItem> } </>) } </MenuList> error: UserProfileThumbnailMenuList.tsx:65 Warning: Each child in a list should have a unique "key" prop. Check the render…

VIEW QUESTION
Back To Top
Search