flat-fuchsia
flat-fuchsia2y ago

How to add menu item for a custom page

Is there any way to add menu item for a custom page? As far as I know useMenu is only using resources.
4 Replies
refine-support-bot
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: You can add a menu item for a custom page by passing an empty resource to the <Sider /> component. SOURCES: ./docs/advanced-tutorials/custom-pages.md

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
foreign-sapphire
foreign-sapphire2y ago
Hey @stevechu, useMenu hook does not return your custom pages. You need to add your custom pages to sider or anywhere manually
like-gold
like-gold2y ago
Hello @stevechu you can read the documentation here: https://refine.dev/docs/advanced-tutorials/custom-pages/
Custom Pages | refine
This document is related to how to create custom pages for react applications. Since Nextjs and Remix have a file system based router built on the page concept, you can create your custom pages under the pages or routes folder.
like-gold
like-gold2y ago
@stevechu there's a simple way for it but not the cleanest one 😅 If you define a resource for the custom page and set the list property with a dummy component, like;
{
name: "my-custom-page",
list: () => null,
}
{
name: "my-custom-page",
list: () => null,
}
this will add my-custom page to the Sider 🕺 🕺