You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Apr 18, 2024
Describe the bug
The error "Uncaught TypeError: items.forEach is not a function" is displayed in MegaMenu when the items property is an array of MenuItem objects.
If you make it an array of arrays, it works as expected.
The documentation clearly shows that items can be either an array Or an array of arrays:
https://primereact.org/megamenu/#api.MenuItem.props.items
Reproducer
https://stackblitz.com/edit/npktaj?file=src%2FApp.jsx
PrimeReact version
latest
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
set items property of a megamenu item to be a single array, such as:
Expected behavior
The single array of menuitems should render
The text was updated successfully, but these errors were encountered: