I want to render more than one children inside of one-liner if else statement. I use ReactJS and MUI. How do I return/render more than one element (an icon and a string with text inside of it)?
<Button type="submit">
{isTyping ? "QISALD" : <OpenInNewIcon/> "LİNKƏ KEÇİD ET"}
</Button>
*isTyping is a state with a boolean value.
>Solution :
You can use a fragment like here:
<Button type="submit">
{isTyping ? "QISALD" : <><OpenInNewIcon/> "LİNKƏ KEÇİD ET"</>}
</Button>