title: Axios is undefined in React, error: Uncaught TypeError: Cannot read property 'post' of undefined
body: <p>I have installed the axios package with: <code>npm i axios</code>.
  I import it in my redux action and Im trying to <code>axios.post()</code>, but the axios object is undefined.
  It posts successfully with <code>.fetch()</code>
  I'm using "axios": "^0.19.2" &amp; "react": "^16.13.0".</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { axios } from "axios";
  
  // Login User
  export const login = () =&gt; dispatch =&gt; {
      const requestOptions = {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ email: "jan@gmail.com", password: "password" })
      };
      axios.post("https://freunder.uber.space/login", requestOptions)
        .then(response =&gt; response.json())
    };</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/2d5LD.png" rel="nofollow noreferrer">Browser error</a></p>