List Component

Replace the generic function with a React Component.

React design patterns

Before moving on to the next topic, we’ll make our code a little more React-like. The way we implemented the generation of our list elements before works, but it is not a best-practice React design pattern. Since we are already returning a list of React elements anyway, let’s change our generic function to be an actual React component instead.

Get hands-on with 1400+ tech skills courses.