Next.js Discord

Discord Forum

error using slots

Answered
Philadelphia Vireo posted this in #help-forum
Open in Discord
Philadelphia VireoOP
export default function Layout({
children,
setting,
notification,
}: {
children: React.ReactNode;
setting: React.ReactNode;
notification: React.ReactNode;
}) {
console.log(notification);
return (
#Unknown Channel
{children}
{setting}
{notification}
</>
)
}

my layout.tsx file for dash folder
only one slot is getting rendered, the one which is at the top of the directories/the one which is created first
all the other props are not rendering
and on console logging any slot other than the one rendering, it shows undefined on console
all the naming and the render functions in the page.tsx are correct
still whats the issue?
Answered by Ray
try rm -rf .next and restart the dev server
View full answer

9 Replies

Answer
Philadelphia VireoOP
okk thanks
now its working👍
but why do i need to restart the server after creating every slot?
otherwise the newly added slots are not working
even i hard refresh the page right from the home route, still restarting the server is needed!!>
Sometimes need to remove .next folder and let next regenerate the file
Philadelphia VireoOP
🫠
okkk bruhh👍
thankss