title: React: Perform action, only once, when html element is clicked
body: <p>In jQuery, it's pretty trivial to perform an action, only once, when an event is triggered on the <code>html</code> element.</p>
  
  <p>For example:</p>
  
  <pre><code>$(".dropdown-trigger").on("click", function(event) {
    var self = this;
    $("html").one("click", function() {
      $(self).parents(".dropdown").removeClass("active");
    });
    $(this).parents(".dropdown").toggleClass("active");
  
    event.stopPropagation();
  });
  </code></pre>
  
  <p>In React, it's not so easy.</p>
  
  <p>How can I perform an action, in React, when the html element is clicked, and perform that action only once (similar to my jQuery code)?</p>