You get a bonus - 1 coin for daily activity. Now you have 1 coin

Why are fragments better than container elements? in REACT

Practice



  1. Fragments are a little faster and use less memory, since they do not create an extra DOM node. This only brings a real benefit on very large and deep trees.
  2. Some CSS mechanisms, such as Flexbox and CSS Grid, have special parent-child relationships, and adding a div in the middle makes it harder to keep the layout you want.
  3. The DOM inspector is less cluttered.
created: 2020-02-23
updated: 2026-03-10
220



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone