Next.js Discord

Discord Forum

Should page files always be server side component or can be client side?

Answered
Yellow-headed Blackbird posted this in #help-forum
Open in Discord
Yellow-headed BlackbirdOP
I am currently building a web app and I got an error saying that I cannot use await on params because the function isn't async. But then on making the default export function async, I get an error saying that client components do not support async which then makes me believe that I should convert this to a server component. Anyway long story short - do page files need to be server components only?
Answered by Asian black bear
Doing so you're opting out of pretty much all app router and RSC features.
View full answer

2 Replies

Asian black bear
They don't need to be but it's an antipattern if they are not server components.
Asian black bear
Doing so you're opting out of pretty much all app router and RSC features.
Answer