title: Checking parameter types in Typescript
body: <p>I'm trying to check the type of my params in my React/Typescript component </p>
  
  <pre><code>foo(e: React.MouseEvent&lt;HTMLElement&gt; | React.KeyboardEvent&lt;HTMLElement&gt;) {
      if(e is mouse event) {
          //do something
      }
      else if (e is KeyboardEvent) {
          //do something else
      }
  }
  </code></pre>
  
  <p>How can I write the if/else conditions?</p>