Storing Tags in JSX Variables and Constants
You can store tags in variables and constants and then insert them into the desired location.
See example:
function App() {
const str = <p>text</p>;
return <div>
{str}
</div>;
}
The rendering result will be the following code:
<div>
<p>text</p>
</div>