TypeScript · Junior · Question 68 of 75

Which type should a React component use for children that may be text, elements or nothing?

Explanation

ReactNode includes strings, numbers, elements, arrays, null and undefined. JSX.Element allows only a single element.

Further reading

Problem with a question

TypeScript · Junior · question 68

Test yourself

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

Take this quiz