-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Component
Menu
Is your feature request related to a problem? Please describe.
Currently, the MenuItem component renders as a element internally. This prevents it from being used for client-side navigation with libraries like react-router-dom, as it causes a full page reload. This tight coupling limits the Menu component's usability, especially within other components like Navigation that rely on it for core functionality.
Describe the solution you'd like
Add a render prop to the MenuItem component to allow for custom link rendering.
-
This prop should be a function that receives one argument:
-
linkData: An object containing the item's data, like { id, title } and any other relevant props from the MenuItem.
-
The MenuItem will internally use React.cloneElement to take the element returned by the render function and automatically inject the necessary props (className, onClick, etc.) and content (Icon, text).
Here is how you would use the render prop for a simple, static link where the path is known ahead of time.
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
yes
Additional context
No response