title: function argument types when get a value from an HTML element on react
body: <p>So Im just making a function that gets a value from an HTML element (LI tag). And this function will be called on an onClick event as well.</p>
  
  <pre><code>const getContents = (e: any) =&gt; {
    const data = e.target.textContent.split('some-separator') //.. and so on
  
    // other stuff
  }
  
  return (
    &lt;li onClick={(e) =&gt; getContents(e)}&gt;{some date}&lt;/li&gt;
  )
  </code></pre>
  
  <p>for the meantime, I'm putting <code>any</code> as I don't know and can't narrow the type for now. What would be the correct type for this, and when I try to put a fancy type - typescript would scream </p>
  
  <blockquote>
    <p>(property) Node.textContent: string | null - Object is possible 'null'</p>
  </blockquote>