title: Double click and click on ReactJS Component
body: <p>I have a ReactJS component that I want to have different behavior on a single click and on a double click.</p>
  <p>I read <a href="https://stackoverflow.com/questions/25777826/onclick-works-but-ondoubleclick-is-ignored-on-react-component">this</a> question.</p>
  <pre><code>&lt;Component
      onClick={this.onSingleClick}
      onDoubleClick={this.onDoubleClick} /&gt;
  </code></pre>
  <p>And I tried it myself and it appears as though you cannot register both single click and double click on a ReactJS component.</p>
  <p>I'm not sure of a good solution to this problem. I don't want to use a timer because I'm going to have 8 of these single components on my page.</p>
  <p>Would it be a good solution to have another inner component inside this one to deal with the double click situation?</p>
  <p>Edit:</p>
  <p>I tried this approach but it doesn't work in the render function.</p>
  <pre><code>render (
  
      let props = {};
  
      if (doubleClick) {
          props.onDoubleClick = function
      } else {
          props.onClick = function
      }
      &lt;Component
          {...props} /&gt;
  );
  </code></pre>