From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

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

Creating edit user page

Creating edit user page

Now that we have implemented the add user functionality and also rendered the users in the table, it is time to work on the edit user functionality. So the first step is going to be to create the edit user interface. So first, we will create the edit route. So in the users folder, I'll create folder named edit and another folder inside it with the name square brackets user id. When the edit button is clicked, we will redirect to the users slash edit slash user id route and using the params, we will get the selected users id for reference. So moving on, let me create the page dot js and let's create the component inside it by by saying const editUserPage is equal to async. In the brackets, we'll have params and we'll return the JSX and an empty fragment. Let's also export the component by saying export default editUserPage. Now let's create the screen component for this route. I will create the edit folder inside the users folder here and create the index.jsx file. In the index.jsx, I…

Contents