Server call during build
Answered
Zepeto posted this in #help-forum
ZepetoOP
Hi, in my application I fetch my API to retrieve data from a server component, I don't want it to be called at build but only when the client makes a request. Currently I call my promise in the server component and then pass it to the client, where I use react's use hook to retrieve the data.
How can I fix this ? Thanks
How can I fix this ? Thanks
3 Replies
ZepetoOP
Up 🙏
Use
export const dynamic = 'force-dynamic'
Answer
@Brokenwind Use `export const dynamic = 'force-dynamic'`
ZepetoOP
Thanks, I hadn't thought of that