I’ve been learning NextJS for the past few months, coming from about 10 years of Python development.
It took a minute, but I get the Client/Server side split, and where to use hooks, etc.
In a lot of the tutorials that I’ve been reading, there is invariably a form that submits data that needs to be a Client component. In almost every one of those examples, the onSubmit function is async, and contains at least one await call to the database.
It looks like this is a special case where a Client component can make a Server call, but I can’t find any documentation saying so. I have made it work in apps that I’ve built, but I’m more interested in why this is the case. Why is this allowed? Or are people just exploiting a loophole, and this shouldn’t work in production?
Thanks for any guidance.