title: Conditional rendering react js
body: <p>Ok, trying to render date from one component into a second component, but using conditional rendering so if date on component 1 is null, component 2 date field will not render. New to react. using following logic.</p>
  
  <pre><code>const enpDate = (earlyNotificationDate);
  if (enpDate) {
      moment(earlyNotificationDate, 'MM/DD/YYYY')
  }
  </code></pre>
  
  <p>Mentor does not like it and would rather wrap in function. Cannot get function to render properly.</p>