Loading state of a `'use server'` component
Is it possible to have a loading state for e.g. a form submission using the new
use server
directive in nextjs 13.4?
I only see using client components at this point when I'm looking at the docs. Am I missing somehting? 😂1 Reply
You can’t, the whole point of RSC is to load everything on server then return the html without JavaScript to the client, however, you can use React suspense to show a loading UI before the RSC is ready.
As for form submission loading UI, I don’t think you can ever achieve that in RSC, you will have to use client component instead.