Untitled

{name === 'pavan' ? <h1>Hi Pavan</h1> : <h1>Hi Guest</h1>}

If the name is pavan it renders the Hi Pavan H1 element

  1. Using Ternary Operator
{isLoggedIn ? 'Log out' : 'Log in'}
  1. Using Logical && Operator
{isLoggedIn &&  'Log in'}