Why my `/post` page is dynamic rendered?
Answered
M7ilan posted this in #help-forum
M7ilanOP
Hello, my
I used the
/post page shows that it's dynamic rendered when building time, there's nothing to dynamic it's just a post form for people to post their posts.I used the
force-static but I don't want to, I just want to know why it's dynamic rendered.22 Replies
M7ilanOP
Here's the file
src\app\(app)\post\page.tsx// export const dynamic = "force-static";
import PostForm from "@/components/post/PostForm";
export default function page() {
return (
<div className="grid">
<h1>...</h1>
<p className="text-muted-foreground">...</p>
<hr className="my-4" />
<PostForm />
</div>
);
}The
PostForm component is big so I'll do my best explaining it is.it's a Form that uses
There's a
I have tried using the
react-hook-form with zod, it's mostly like in [this page](https://ui.shadcn.com/docs/components/form).There's a
onSubmit function which I think it causes the dynamic rendering I think, it uses server actions to create the post and upload images in the database and finally uses next/navigation router to push the user to his post when it's created.I have tried using the
force-static and it works great but as I said I want to know the reason this happening. I also hate forcing. thank youM7ilanOP
yup
it's private..
give me a sec I can publish it
[](https://github.com/OmarAfet/bs6h/blob/master/src/app/(app)/post/page.tsx)
src/app/(app)/post/page.tsx[](https://github.com/OmarAfet/bs6h/blob/master/src/components/post/PostForm.tsx)
src/components/post/PostForm.tsxwhats your build log
try using
export const dynamic = 'error'then see what error it will print
M7ilanOP
wait, that image uses
force-staticthere you go
you used
cookies()Answer
M7ilanOP
hmm
I used it in a server action tho
if you call that server action in server components it is being called normally
if you call that server action in server components, it is just calling a normal function
M7ilanOP
I see
yeah, unless you call it in form actions or client components