Current section: Server Actions 27 exercises
Problem

Action Reference

Loading exercise

Transcript

00:00 For this step, we're not actually going to be able to call the server or anything. What we're doing right now is getting the action into our RSC payload so that when it comes time to call the server, we can do so. So our users want to be able to make changes to the titles of these ships, and I think that's a perfectly reasonable thing to do.

00:19 So what we need to do is get our server action that we have already set up so that it will be referenceable in our client code. You can take a look at actions right here. We've got some work to do in there, but this update ship name needs to somehow make its way over to our client-side code

00:36 for the form that we have in our editable text. So that's part of what you're going to be doing. When you're finished, you should be able to go to slash RSC with the ship ID and a search, and you'll be able to see that reference showing up in here, which will be kind of interesting.

00:54 Also, it could be useful to add a couple console logs. We've got some spots for you so that you can look at, like, how does the use server directive change the way that this module looks like to our application when we're generating the RSC payload, and what does it look like to our use client code, all of that stuff and more.

01:13 It's going to be great, so let's get into it.