title: State in React Hook useEffect has a missing dependency
body: <p>How can I remove warnings like this error <code>src\components\pages\badge\BadgeScreen.tsx Line 87:6:  React Hook useEffect has a missing dependency: 'loadData'. Either include it or remove the dependency array  react-hooks/exhaustive-deps</code></p>
  <p>Here is my code:</p>
  <pre><code>const location = useLocation();
    const { badge }: any = location.state;
  
      const [data, setData] = useState({
          id: &quot;&quot;,
          badge_name: &quot;&quot;,
          badge_description: &quot;&quot;,
          imgBase64: &quot;&quot;,
          img_icon: &quot;&quot;,
        });
      
              useEffect(() =&gt; {
              setData(badge);
            }, [badge]);
  </code></pre>
  <p>Everything is working fine, but I am having a hard time fixing this issue.</p>
  <p>Thank you!</p>