In React 16.2, improved support for Fragments has been added. More information can be found on React\'s blog post here.
We are all familiar with the fol
As per the reactjs.org docs most important needs of instead of div's are to avoid breaking HTML semantics. When we use div's instead of we break the HTML semantics.
To know more about html semantics. please click and also there are cases where if you use div's instead of Fragments it will be invalid html, for example look at this code:
class Columns extends React.Component {
render() {
return (
Hello
World
);
}
}
Hello
World
Fragments solve this problem.