New page not shown on main page on click, but navigates away unlike the 2 examples in the given repo
my new page shows in the sidebar but navigates to a new page unlike the 2 existing demo apps
I added this to my resources in src/app/layout ( using the nextjs version)
{
name: "createUser",
list: "/create-user",
meta: {
label: "Create User",
},
},
3 Replies
Hi @Tejas. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It seems like you are trying to add a new page to your Next.js application using Refine, but the navigation behavior is not consistent with the existing demo apps. Based on the information provided, it looks like you have added the new resource correctly, but there might be an issue with how the routes are defined or how the layout is structured.
Here are some steps to ensure that your new page integrates correctly with the existing layout and navigation:
1. Define the Route for the New Page:
Make sure you have defined the route for the new page in your
src/app/layout
or equivalent file. This ensures that the new page is part of the main application layout and uses the same navigation structure.
2. Update the Layout with the New Route:
Ensure that the new route is included in the main layout component. Here is an example of how you can update your layout to include the new route:
3. Ensure the New Page Component is Correctly Defined:
Make sure that your new page component (CreateUser
) is correctly defined and exported. For example:
By following these steps, your new page should integrate seamlessly with the existing layout and navigation structure, ensuring consistent behavior with the other demo apps.
For more detailed information, you can refer to the Adding a Layout (https://refine.dev/blog/awesome-react-windows95-ui-with-refine/#adding-a-layout) section in the Refine documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@908789132363464705> kapa.ai is still learning and improving, please let us know how it did by reacting below
sunny-greenOP•5mo ago
answer was that i missed the layout.tsx file for my new page ( wasnt clear that this was needd)