title: React TypeScript get Data Attribute From Click Event
body: <p>So I have a React component with a button which has a click handler which uses the data-* attribute. If this was straight React then I know how to get the value from the data-* attribute. However I am learning how to use TypeScript so I have no idea how to get access to this attribute. So what is the best way to get access to the data-* attribute using TypeScript?</p>
  
  <p>This is my JSX code for the button:</p>
  
  <pre><code>&lt;button type="button" className="NavLink" data-appMode={ AppMode.MAIN } onClick={ this.handleAppModeClick.bind(this) }&gt;Main&lt;/button&gt;
  </code></pre>
  
  <p>This is my handler for the click event:</p>
  
  <pre><code>handleAppModeClick(e: React.MouseEvent&lt;HTMLElement&gt;) {
      // What code should go here to access the data-appMode attribute?
  }
  </code></pre>