Closed antonzhelyazkov closed 3 months ago
Where is "Icon" defined (imported)?
I tried with:
import { Sidebar, Menu, MenuItem, SubMenu, Icon } from 'react-pro-sidebar';
but also fails
AFAIK, react-pro-sidebar does not have an <Icon />
object. It seems you copy pasted the code, that Icon is a placeholder for whatever icon library you use. react-pro-sidebar is usually integrated with MUI, so MUI Icons should work fine.
E.g. for Calendar icon here: https://mui.com/material-ui/material-icons/?query=calendar
...
import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
...
<MenuItem icon={<CalendarMonthIcon />}> Calendar</MenuItem>
...
Here is a blog entry you might like to read: https://blog.openreplay.com/simple-sidebars-with-react-pro-sidebar-and-material-ui/
Near the middle, there is a section about MaterialUI Icons usage...
Hope this helps...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello,
I need help to show icon. This is my code
And I have got an error
Line 11:30: 'Icon' is not defined react/jsx-no-undef
Can you help me to solve this issue and show icon