I want to understand why the compiled version of this code is invalid
<Fragment>
{listData.list.description && (
<div>
<div dangerouslySetInnerHTML={{ __html: list.description }} />
{hasTopCollection && <ImageAttribution />}
</div>
// ^ ) expected
{list.listOptions.brandHeaderType === 20 && <SomeComponent />}
// ^ Parsing error: Unexpected token, expected ","
)}
</Fragment>
I had this listData.list.description && <Description> component in a parent component, but now I want to move this logic into the actual <Description> component.
So before this was like this:
<Fragment>
<div>
<div dangerouslySetInnerHTML={{ __html: list.description }} />
{hasTopCollection && <ImageAttribution />}
</div>
{list.listOptions.brandHeaderType === 20 && <SomeComponent />}
</Fragment>