title: Handle no internet connection axios, react native app (without NetInfo)
body: <p>I have a screen where image from API rerender every N second. And I would like to handle situation when user didn't connected to the Internet. I was trying to solve this through state, but it's not working. How can i solve this problem?</p>
  
  <pre><code>const [imgUrl, setImgUrl] = useState();
  const [err, setErr] = useState(false);
  
  const getImage = () =&gt;
          Axios.get('https://dog.ceo/api/breeds/image/random')
              .then(response =&gt; {
                  if (response.status &gt;= 200 &amp;&amp; response.status &lt; 300) {
                      return response.data;
                  } else {
                      setErr(true);
                  }
              })
              .then(data =&gt; setImgUrl(data.message))
              .catch(err=&gt;console.warn(err));
  
  useEffect(() =&gt; {
   getImage();
  }, []);
  
  useEffect(() =&gt; {
    const timer = setInterval(getImage, value * 1000);
    return () =&gt; clearInterval(timer);
  }, [value]);
  
  return (
    &lt;View&gt;
      {err === false ? &lt;Image style={styles.img} source={{ uri: `${imgUrl}` }} /&gt; : &lt;View&gt;&lt;Text&gt; please, check your network connection! &lt;/Text&gt;&lt;/View&gt;}                                                   
    &lt;/View&gt;
    &lt;Text&gt;{value}&lt;/Text&gt;
    &lt;Slider value={value} onValueChange={(sliderValue) =&gt; setValue(sliderValue)} /&gt;
  
  );
  </code></pre>