Fragment Quiz
Test your knowledge of React Fragment, including shorthand syntax, grouping elements, keys, DOM output, lists, and common caveats.
20 questions · free · answers explained
All questions in this quiz
- What is the main purpose of React Fragment?
- Which syntax is the common shorthand for Fragment?
- When should you use the explicit Fragment syntax instead of the shorthand?
- What does Fragment add to the resulting DOM?
- Why can Fragment be better than a wrapper div in some layouts?
- Which import is needed for explicit Fragment syntax?
- What is a common use for keyed Fragments?
- Can the shorthand Fragment syntax receive a key prop?
- Which situation is a good fit for Fragment?
- Does Fragment change the behavior of child components by itself?
- Why is Fragment useful in table markup?
- Which statement about Fragment and CSS is accurate?
- What should you use if you need a real wrapper for styling or layout?
- Can Fragment contain text nodes as well as components?
- Which prop can stable explicit Fragments commonly receive?
- What is the result of replacing a wrapper div with Fragment?
- What is a limitation of Fragment shorthand?
- Which JSX return is valid because of Fragment shorthand?
- Does Fragment help avoid unnecessary semantic markup?
- What is the practical rule for Fragment?
Prefer to read first? React interview questions with written answers.