5 ms·
Use client and use server aren’t great, but the fact they had to be declared at the top of a file was at least clear. Starting to scatter magic strings through
by drawfloat 11mo ago
Use client and use server aren’t great, but the fact they had to be declared at the top of a file was at least clear.
Starting to scatter magic strings throughout a code base feels like a real step back.
- c-hendricks 11mo agoThere's nothing about "use server" that requires it to be at the top of the file though, it can go in function bodies and you have a typed RPC method. I think "use client" is the only one that has to go at the top of a file.
- TimReynolds 11mo agoYou are correct. Use server can be slapped in many places