title: React + Redux + Thunk: multiple hooks on the same event
body: <p>I've got stuck with a problem of hook reusage when state and redux store should work together. I've simplified a code to show the problem.</p>
  <p>There is a component where I want to use multiple hooks (for simplicity I re-use <code>useMouseDown</code> hook here):</p>
  <pre><code>export function Counter() {
    const count = useSelector(selectCount);
    const dispatch = useDispatch();
    const plusSighRef = useRef&lt;HTMLButtonElement&gt;(null);
  
    useMouseDown({
      ref: plusSighRef,
      onMouseDown: () =&gt; {
        console.log('in first hook');
        dispatch(increment());
      }
    });
  
    useMouseDown({
      ref: plusSighRef,
      onMouseDown: () =&gt; { console.log('in second hook'); }
    });
  
    return &lt;button ref={plusSighRef}&gt;+&lt;/button&gt;;
  }
  </code></pre>
  <p>Each hook has inner state and has own callback on mouse down event:</p>
  <pre><code>const useMouseDown = ({ ref, onMouseDown }) =&gt; {
    const [isClicked, setIsClicked] = useState(false);
    useEffect(() =&gt; {
      const element = ref.current;
  
      const down = (e: MouseEvent) =&gt; {
        setIsClicked(true);
        onMouseDown(e);
      }
      element.addEventListener('mousedown', down);
  
      return (): void =&gt; {
        element.removeEventListener('mousedown', down);
      };
    }, [onMouseDown, ref]);
  }
  </code></pre>
  <p>As a result a mousedown event in second hook is never triggered. The problem is that re-render occurs earlier than second hook is started.</p>
  <p>I found some solutions but don't like both:</p>
  <ol>
  <li>use something like <code>setTimeout(() =&gt; dispatch(increment()), 0)</code> inside the first hook mousedown prop. But it seems to be not obvious in terms of re-usage.</li>
  <li>rewrite two hooks into one and manipulate with one &quot;big&quot; mousedown handler. But in that case a combined hook could be difficult for maintaining.</li>
  </ol>
  <p>So I need a solution that allow to retain structure as is (I mean two separate hooks), but has second hook is working too. Could someone help how to get it?</p>