The EditCourse component

In the frontend, we will add a view for editing a course and it will have two sections. The first part will let the user change the course details, including the name, category, description, and image; and the second part will allow the modification of the lessons for the course. The first part of this course is pictured in the following screenshot:

To implement this view, we will define a React component named EditCourse. This component will first load the course details by calling the read fetch method in the useEffect hook, as shown in the following code.

mern-classroom/client/course/EditCourse.js

 useEffect(() ...

Get Full-Stack React Projects - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.