React - populate data conditionally; show this if exist, or else show this

0 votes
23 views
added Nov 14 in JSX by lcjr First Warrant Officer (11,780 points)

// else show that
{seoTitleWithAsset ? (
  <>{title}</>
) : (
  <> do this</>
)}

// if exist, show this
<h2>Overview</h2>
{seoTitleWithAsset && (
  <p>{title} </p>
)}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...