Next.js Discord

Discord Forum

I am not understanding forms

Unanswered
Kromfohrländer posted this in #help-forum
Open in Discord
KromfohrländerOP
I have a form built out as a component in a client component. I have a page which fetches data from an rest api(server). In this server page I have the client form component, now I want the data that is being fetched from the api server in the client component because I need that data for the client component form. How would this approach work?

18 Replies

Nile Crocodile
you can just pass data from server component to client component
KromfohrländerOP
Could you possibly tell me how this is done, or send me the doc link?
I cant seem to find it
just pass it to the form?
Users is my server component, in that I'm getting data, and passing it to <AddUser/> form (client component).
KromfohrländerOP
Do you mind making a screenshot of
Off the <AddUser/> componebt
I want to see how you have written the form in that client component
I'm using zod, and react-hook-form
KromfohrländerOP
Understood, thanks alot man. Appreciate ut
It*
NP, if your problem is solved, consider marking answer as solution
KromfohrländerOP
In a half hour i am going to start writing again. Is it allowed jn the rules to keep this open until I solved it in my codebase
no problem at all, only close when you've solved it completely
KromfohrländerOP
Really appreciate your help. Will send a msg when I am stuck if you dont mind💪💪
sure, send the message here if you're stuck
KromfohrländerOP
👍👍