From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Update user form

Update user form

Now, we want to create our update user form. So we're going to go into app admin users brackets ID. And then in that folder, we're going to create update-user-form.tsx. And then let's call this, we'll call it update user form. And then let's see, this is going to be a client component. So let's say Use Client at the top. And for now, we're just going to output. And we'll just say Update Form. So let's save that. And then let's bring it into our page. So let's see. We're going to import it at the top here. Import Update User Form. And then where I'm going to put it is right under the H1 that we did in the last video. So Update User Form. And it's going to get passed in the user, which ultimately is coming from this right here, from our getUserById. OK, we're just getting this TypeScript error because this doesn't accept user as a prop. So let's fix that. And let's pass in here. In props, we want user. And then for the type, we're going to say user. And I want to infer the update user…

Contents