title: cannot be used as a JSX component Its return type string | Element is not a valid JSX element Type 'string' is not assignable to type 'Element | null'
body: <p>I created a react function  EventDateTooltip:</p>
  <pre><code>import React from 'react';
  import { endOfDay, isToday, isTomorrow, isYesterday } from 'date-fns';
  import { useTranslation } from 'react-i18next';
  import I18nWrapper from '../i18n-wrapper';
  import DateFormater from '../formaters/date-formater';
  
   const EventDateTooltip = ({ date }: { date: string }) =&gt; {
   const { t } = useTranslation();
   const dateTooltip = endOfDay(new Date(date));
    if (isTomorrow(dateTooltip)) return t('tooltip.event.date.tomorrow');
    if (isYesterday(dateTooltip)) return t('tooltip.event.date.yesterday');
    if (isToday(dateTooltip)) return t('tooltip.event.date.today');
  
   return (
     &lt;&gt;
    &lt;span key={date.toString()}&gt;
      &lt;I18nWrapper translateKey=&quot;tooltip.event.date.the&quot; /&gt;{' '}
      &lt;DateFormater dateToFomat={date} formater=&quot;full-date&quot; /&gt;
    &lt;/span&gt;
  &lt;/&gt;
    );
  };
  
  export default EventDateTooltip; 
  </code></pre>
  <p>this function return a text and a translated date.</p>
  <p>when I call this function on another component:</p>
  <pre><code> &lt;EventDateTooltip date={props.event.endDate}&gt;&lt;/EventDateTooltip&gt;;
  </code></pre>
  <p>the call returns the following error message:</p>
  <pre><code>Its return type 'string | Element' is not a valid JSX element.
     Type 'string' is not assignable to type 'Element | null'.  TS2786
  </code></pre>
  <p>has anyone got the following message ?</p>