Next.js Discord

Discord Forum

Parsing Prop From Component To Another Component Through Layout.jsx

Unanswered
Fila Brasileiro posted this in #help-forum
Open in Discord
Fila BrasileiroOP
I created a dashboard page by following a YouTube tutorial. I attached the codes in the image:

There is a Layout (app/dashboard/layout.jsx) which will later be used as a global layout so that content in the form of pages such as dashboards, forms, etc. is substituted into {children} contained in layout.jsx.

In layout.jsx there is also a Navbar component with its header using a url by replacing "/" with " > " (This is done in the Navbar component itself). This is used as a Breadcrumb, but if the URL leads to data with an ID such as user or product, then the ID of that item will be displayed in the Navbar.

For example, as in the picture, I created an AddUserPage component as a user details page with a certain ID in the app/dashboard/users/add/page.jsx file (Sorry, the name is wrong, it should be EditUserPage)

How do I send custom text from AddUserPage which will later be used as a header in the Navbar component?

Thank you
Best Regards

0 Replies