April 2020
Intermediate to advanced
716 pages
18h 55m
English
For displaying the list of published courses, we will design a component that takes the array of courses as props from the parent component that it is added to. In the MERN Classroom application, we will render the published courses on the home page, as pictured in the next screenshot:

In the Home component, we will retrieve the list of published courses from the backend in a useEffect hook, as shown in the following code:
mern-classroom/client/core/Home.js
useEffect(() => { const abortController = new AbortController() const signal = abortController.signal listPublished(signal).then((data) => { if (data.error) { console.log(data.error) ...Read now
Unlock full access