title: How to use UseEffect for Custom React hook?
body: <p>Hello I have custom hook</p>
  <p>code is like below</p>
  <pre><code>import * as React from 'react'
  
  export const myCustomHook = (props?: boolean) =&gt; {
    const [value, setValue] = React.useState([]);
  
    React.useEffect(() =&gt; {
      return (async (p1) =&gt; {
        // ....
        setValue(someValues)
      })
    }, [])
  
    const myFun = async (prop1) =&gt; {
      //  ...  some operations
      return {id: id}
    }
  
    return { myFun, value }
  }
  
  </code></pre>
  <p>I am using the above like this</p>
  <pre><code>const { value, myFun } = myCustomHook();
  const foofun = async (pp) =&gt; {
    const myfunRes = await myFun(prop1);
  }
  
  </code></pre>
  <p>Now I want to put <code>myFun</code> in <code>useEffect</code></p>
  <p>Please help me with this.</p>