React TutorialLesson 25Free preview
React Props Children
This lesson is part of React · All levels
Summary
Props children contain elements or text that are placed between the opening and closing tags of the component. This pattern is useful for creating packaging components such as Card or Capital that display any content from the user. With children, the components become a highly flexible generic container.
Key points
- Props.children accommodates elements between component tags
- Packaging components like Card use children for free content
- Children can be text, elements, even a list of elements.
- Children remained a regular prop so they could be structured as well.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.