Do 'use client' and 'use server' declarations remain necessary in Next.js 14's Pages Router?
Answered
Serengeti posted this in #help-forum
SerengetiOP
In Next.js 14, is it still necessary to explicitly declare 'use client' or 'use server' in components when using the Pages Router?
Or can i just continue safely what i did with 13.
Or can i just continue safely what i did with 13.
13 Replies
@Serengeti So you are asking if you need "use client" or "use server" in page router?
@James4u <@221838936866029568> So you are asking if you need "use client" or "use server" in page router?
SerengetiOP
yes because i am planning to update my nextjs 13
yeah, it's okay. they are just for app router
SerengetiOP
thank goodness
as long as you remain in page router, version shouldn't be a matter
SerengetiOP
yes thank you. because i saw this but this one is migration https://nextjs.org/docs/pages/building-your-application/routing/pages-and-layouts
@Serengeti In Next.js 14, is it still necessary to explicitly declare 'use client' or 'use server' in components when using the Pages Router?
Or can i just continue safely what i did with 13.
But why do you need those directives in page router?
SerengetiOP
than you for that info
as I said before, they are only for app router
@James4u But why do you need those directives in page router?
SerengetiOP
nono im lazy to do that so i asked
if i need to do that then i will not update XD
oh, yeah, you don't need them in your page router!
Answer
Mark solution if it helped you! 🙂