title: React-Native 404 on Axios call first time... fine on 2nd
body: <p>So I am building a simple app that basically gets a device ID then sets some data for that device ID.</p>
  <p>The API calls work, and the URLs are all fine.</p>
  <p>The weird thing is when testing this app on the simulator... when I run the function, it throws a 404. However, if I click the button again, it runs just fine. If I put new data in the text input, it throws a 404, push the button again it works fine.</p>
  <p>I have tested all the input setters and all are storing in state before the button push. So I dont think that is the issue...</p>
  <p>here is the axios call</p>
  <pre><code> const setDevice = async () =&gt; {
      setIsLoading(true);
      setShowModal(false)
      try {
        const response = await axios.get(url + serialNumber, {
          headers: { Authorization: authHeader },
        });
        setId(response.data.mobile_devices[0].id);
      } catch (err) {
        console.log(error.message)
        setError(&quot;Something went Wrong&quot;);
        setIsLoading(false);
        setShowModal(false)
        setShowErrorModal(true)
      }
      await axios.put(url + id, body, {
        headers: { Authorization: authHeader, &quot;Content-Type&quot;: &quot;application/xml&quot; },
      });
      setIsLoading(false);
    };
  </code></pre>
  <p>I have even tried to hard code the API alls just to see if that was the problem, and it was not. so making the text inputs not even a factor I still get this error..</p>
  <p>Again, running it a 2nd time, works.</p>
  <pre><code>[Unhandled promise rejection: Error: Request failed with status code 404]
  - node_modules/axios/lib/core/createError.js:15:17 in createError
  - node_modules/axios/lib/core/settle.js:16:9 in settle
  - node_modules/axios/lib/adapters/xhr.js:52:6 in handleLoad
  - node_modules/event-target-shim/dist/event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
  - node_modules/react-native/Libraries/Network/XMLHttpRequest.js:567:4 in setReadyState
  - node_modules/react-native/Libraries/Network/XMLHttpRequest.js:389:6 in __didCompleteResponse
  - node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:189:10 in emit
  - node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:425:19 in __callFunction
  - node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:6 in __guard$argument_0
  - node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:373:10 in __guard
  - node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:111:4 in callFunctionReturnFlushedQueue
  * [native code]:null in callFunctionReturnFlushedQueue
  </code></pre>