Why fragments are better than container div in react.js?

Answer

There are many reasons why Fragments are better:

1) Fragments are a bit faster and use less memory by not creating an extra DOM node.
2) This only has a real benefit on very large and deep trees.
3) Some CSS mechanisms like Flexbox and CSS Grid have a special parent-child relationships, and adding divs in the middle makes it hard to keep the desired layout.
4) The DOM Inspector is less cluttered.

All react js Questions

Ask your interview questions on react-js

Write Your comment or Questions if you want the answers on react-js from react-js Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---