What is the children prop?

React JSX, components and props · Freshers

Model answer

children holds whatever you put between a component's opening and closing tags: <Card><p>Hello</p></Card>. The Card component receives it as props.children and decides where to render it.

It is how you build wrapper components such as cards, layouts and modals that accept any content.

Learn this topic

React Components and Props Explained with Examples in the course React.js Full Course: Beginner to Advanced.

Sign in to add your own answer.

More questions