Next.js Discord

Discord Forum

next Js 14 - server side rendering with app

Answered
Californian posted this in #help-forum
Open in Discord
CalifornianOP
Hi !

How can I use getServerSideProps in my Next Js 14 app to do server side rendering while I have the app folder in my project ?
Answered by Ray
by default, every component is server component. You could fetch the data inside the component in app router
View full answer

13 Replies

@Californian Hi ! How can I use getServerSideProps in my Next Js 14 app to do server side rendering while I have the app folder in my project ?
by default, every component is server component. You could fetch the data inside the component in app router
Answer
CalifornianOP
Thank you ! Appreciate your reactivity !
CalifornianOP
Just out by curiosity, in which case you I use getServerSideProps then ? ( I am using next js 14)
getServerSideProps doesn't work with app router
CalifornianOP
Thank you !
CalifornianOP
Sorry to bother you again ... But here is what I have done ! This is page (in app/test/page.tsx).

getTest.tsx is a call to my database Supabase. (typically, it queries all the data in the table test).

But it does not work. Is it the correct way to do it ? Because it does not work, and when I query it in the client side, it works properly !
CalifornianOP
Hmm ok i see. All in this guide is what I did ! Does it mean that I can not use the server side of Next Js ? It seems I can just query my data in a client side ! Why I am asking that is because I wanted to benefit the performance of the server side rendering in Next Js. Do you get my point ? Thank you again for your answer
CalifornianOP
I will look at it ! Thank you for your reactivity !