Next.js Discord

Discord Forum

Disable default convert to static?

Answered
Red-necked Grebe posted this in #help-forum
Open in Discord
Red-necked GrebeOP
hi i have question,
page
- page.tsx << this is "use server"
  /element
  - header.tsx << this is "use client"


but the compiler decided to compile all in client, even inside the page.tsx there is server render (hardcoded), can i disable it so it would partially render page in server then the header in client?

thanks in advance
Answered by joulev
that is [static rendering](https://nextjs.org/docs/app/building-your-application/rendering/server-components#static-rendering-default), not client components.

static rendering = the page is rendered at build time, so it can be cached and is much faster.

do you want to switch to dynamic rendering (the page is rendered at request time)? if so, add export const revalidate = 0 to the page.

if you have used the pages router, static rendering is like getStaticProps while dynamic rendering is like getServerSideProps.
View full answer

5 Replies

@joulev 1. `use server` is not the directive to mark server components. remove it. 2. page.tsx should already be a server component. to confirm you can `import "server-only"` there
Red-necked GrebeOP
for point number 2
<div> component page.tsx marked as pre-render as static
tries using server-only but still opt this..
or if there is no async-call , only jsx component with tailwind it would converted into static content?
@Red-necked Grebe for point number 2 <div> component `page.tsx` marked as pre-render as static tries using `server-only` but still opt this..
that is [static rendering](https://nextjs.org/docs/app/building-your-application/rendering/server-components#static-rendering-default), not client components.

static rendering = the page is rendered at build time, so it can be cached and is much faster.

do you want to switch to dynamic rendering (the page is rendered at request time)? if so, add export const revalidate = 0 to the page.

if you have used the pages router, static rendering is like getStaticProps while dynamic rendering is like getServerSideProps.
Answer