From the course: React: Advanced Code Challenges

Unlock this course with a free trial

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

Nested components or passing props?

Nested components or passing props? - React.js Tutorial

From the course: React: Advanced Code Challenges

Nested components or passing props?

- [Speaker] React is a component-based JavaScript library used for building user interfaces. It was developed in 2013 by Mina, formerly known as Facebook. And React relies on a powerful architecture model called composition. With Composition, every component is responsible for rendering a small part of the user interface and the user interface can be broken down into small units, so into small components that can be nested inside other components, that makes the building and the maintaining of your React application easier and faster. And components can communicate bypassing props from parents to child components. So let's look at one composition example. Here, we have a card component that displays a welcome message and this card component is nested inside the app components. Now the same card components where we display a greeting message along with a name. And what we do is passing data from the parents to child components, from the app to the card components using the props. And…

Contents