title: React custom hook doesn't update state
body: <p>Here i have a example hooks</p>
  <pre><code>const useGPS = () =&gt; {
    const [gps, setGps] = useState({})
  
    useEffect(() =&gt; {
      setGps({ a: 1 })
    }, [])
  
    return [gps]
  }
  
  </code></pre>
  <p>it's pretty simple, but when i use it inside another Component</p>
  <pre><code>const Foo = () =&gt; {
    const location = useGPS()
    
    useEffect(() =&gt; {
      console.log(location);
    }, [])
  
    return (
      &lt;div&gt;1&lt;/div&gt;
    )
  }
  
  </code></pre>
  <p>console always log empty object for first time. Can someone explain what happened and how can i fix it? Sorry about my bad english. Thanks a lot!</p>