Next.js Discord

Discord Forum

Best way to call API in NextJS

Unanswered
Five-striped Sparrow posted this in #help-forum
Open in Discord
Five-striped SparrowOP
I have a form with 6,7 select box and select box data is populating from the API. Currently, I am calling API inside useEffect and populating the select box.
Any best way to do it in NextJS (App Directory)

2 Replies

You can do the same in nextjs. Use a client component. And yes, the client component is ok, because the user need to interact with it
Why not fetch data server side?