Next.js Discord

Discord Forum

The Use hook

Answered
Eastern Phoebe posted this in #help-forum
Open in Discord
Eastern PhoebeOP
The promise from a Server Component to a Client Component and use the use hook to handle it, the request is typically initiated from the server or the client?
Answered by ᴉuɐpɹɐɐ
the promise will be resolved in the server then it will be passed to which ever "uses" the promise in the client component
View full answer

7 Replies

the promise will be resolved in the server then it will be passed to which ever "uses" the promise in the client component
Answer
@ᴉuɐpɹɐɐ the promise will be resolved in the server then it will be passed to which ever "uses" the promise in the client component
Eastern PhoebeOP
If i send the "fetch(/api/users)" promis from server component to the client component, then the http request should be from server? I'm a newbie sorry
yep
also dont fetch to your own /api
just call the db directly
@ᴉuɐpɹɐɐ yep
Eastern PhoebeOP
Thanks! Helped me a lot!