We all know that we need to wrap the JSX element in a wrapper element, a div or React fragment, I need a way that gives us the ability to write JSX elements without the wrapper element.
I searched all around the web, and No one has A solution, I don't know maybe it's something to do with Webpack or in React Source code.
It's not about specific code, but this code below is for example, according to React standards, we need to write this code like this :
function App(){
return (
<div>
<h1> This is heading1</h1>
<p> This is paragraph </p>
<h2> This is another heading </h2>
<p> This is another paragraph </p>
</div>
);
};
The challenge is to find a way that gives the ability to write it this way without the wrapper div or the use of React fragment:
function App(){
return (
<h1> This is heading1</h1>
<p> This is paragraph </p>
<h2> This is another heading </h2>
<p> This is another paragraph </p>
);
};
I appreciate it if anyone can help.