title: Can't get response from ipify using fetch in React
body: <p>In my React app, I want to get the IP address of the user at client side. I intended to use <code>ipify</code> for that. When I'm using <code>'http://api.ipify.org/?format=json'</code> in the browser, it successfully returns <code>{"ip":"112.135.11.128"}</code>, but I can't get the same response when I'm making request through fetch API. What I get is something like below.</p>
  
  <p><a href="https://i.stack.imgur.com/FjO5E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FjO5E.png" alt="enter image description here"></a></p>
  
  <p><strong>code:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import React, { useEffect } from 'react';
  
  const QRDisplay = () =&gt; {
  
      async function getIP(){
          const response = await fetch('https://api.ipify.org/?format=json');
          const data = await response.json();
          return response.status === 200 ? data : "err"
      }
  
      useEffect( () =&gt; {
          getIP().then(data =&gt; console.log(data))
      },[])
  
      return (
          &lt;&gt;
          &lt;/&gt;  
      );
  };
  
  export default QRDisplay;
  </code></pre>