title: How to use observer to wrapper react custom hook?
body: <p>In my project, I create a custom react hook that needs to use observable state in store for dependencies of useEffect:</p>
  <p>My example custom hook:</p>
  <pre><code>const useFoo = (() =&gt; {
     const { count } = store;
     useEffect (() =&gt; {
        //do something here   
     },[count])
  })
  </code></pre>
  <p>Normally we must wrap observer() the component to make it rerender but observer() does not accept wrap custom hook. I have already referred to another question in this <a href="https://stackoverflow.com/questions/64250328/react-js-how-to-get-mobx-stores-state-using-observer-in-a-custom-hook">question</a> but this isn't clearly answered to me.</p>
  <p>So Anyone can give me a solution to do this. I realize custom hook should be isolated from data to be reusable but in my case, I will save a lot of time to refactor code if I have solution for this problem. Thanks a lot</p>