title: How to give precedence to one hook in react?
body: <pre><code>const handleSelect = (e) =&gt; {
   //do something 
  
  }
  
  const handleChange = (e) =&gt; {
       setChecked(e.target.checked);
  }
  
  
   return (
          &lt;Grid
              container
              direction=&quot;row&quot;
              justify=&quot;center&quot;
              alignItems=&quot;center&quot;&gt;
              &lt;TreeItem
                  onLabelClick={handleSelect}
                  nodeId={nodeId}
                  label={
                      &lt;div&gt;
                          &lt;Checkbox
                              checked={checked}
                              onChange={handleChange}
                          /&gt;
                          {literal}
                      &lt;/div&gt;}
                  onNodeToggle={handleToggle}
              &gt;
              &lt;/TreeItem&gt;
          &lt;/Grid&gt;
      )
  }
  
  </code></pre>
  <p>Trying to create a TreeView with a checkbox. Only issue that I've run into is that when clicking the checkbox, that also expands the tree, which is not the behavior I want.</p>
  <p>How do I override the onLabelClick to not execute if handleChange (the checkbox) was selected?</p>