Make components reusable in React with a flexible props API

Share this video with your friends

Send Tweet

In this lesson, we abstract a reusable NamesList component, that will render the same JSX in two different scenarios. We keep the logic of the onClick event outside of the component, and pass it as a callback prop.