React · Junior · Question 10 of 75

What is children in React?

Explanation

<Card><h2>Title</h2></Card> passes the <h2> in props.children. It's the basis of composition: wrappers, layouts and modals accept arbitrary content. children can be a string, an element, an array or a function (the render props pattern).

Further reading

Problem with a question

React · Junior · question 10

Test yourself

Take the React · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz