Next.js Discord

Discord Forum

How to add pages rendered after clicking a component

Answered
Havana posted this in #help-forum
Open in Discord
HavanaOP
i want to render Yt_gen.tsx file whenever we click a component
Answered by averydelusionalperson
it will be rendered in the path 'Yt-Gen'
View full answer

29 Replies

HavanaOP
this is not working
file name should be Yt_Gen/page.tsx not Yt_Gen.tsx
check new app router docs in next.js
@averydelusionalperson file name should be Yt_Gen/page.tsx not Yt_Gen.tsx
HavanaOP
check file stucture yt gen is the file not folder
IK but it should be folder, that's how new routing works
please check next.js docs
HavanaOP
can i screen share in dm? @averydelusionalperson
can u guide me?
it's not a big change
add a new folder with name Yt_Gen
and add a page.tx file in that folder
the copy paste Yt_Gen.tsx to that page.tsx file
HavanaOP
not working:mind_blow_astonished:
what is not working
HavanaOP
can you wisit Yt_Gen in the website?
HavanaOP
the href should be "/Yt-Gen"
no need to add page.tsx
it's not path
if you add page.tsx in Yt-Gen
HavanaOP
ohhhh
thaks a lot
it will be rendered in the path 'Yt-Gen'
Answer
HavanaOP
i am lil bit messed up with basics
@averydelusionalperson it will be rendered in the path 'Yt-Gen'
HavanaOP
thanks dude
@Havana i am lil bit messed up with basics
no worries, just check next.js docs, it should be not hard
@Havana thanks dude
😃