'Images.js:15 Uncaught TypeError: axios__WEBPACK_IMPORTED_MODULE_0__.Axios.get is not a function

I am getting the following error in React.

Images.js:15 Uncaught TypeError: axios__WEBPACK_IMPORTED_MODULE_0__.Axios.get is not a function

I followed the following process.

  1. I install the npm install axios. 2)then I try to use the method get() for that, I imported the axios> import { Axios } from 'axios';

Here is my function

           inputRef.current.focus()
           Axios.get("https://api.unsplash.com/photos/?client_id=Q6F2UZogduuqcTc6rRGUs6ZOIo8yhNIpP4tiJHm0CrE").then(res => {
               console.log(res);
           } ).then(res => {
               console.log(res);
           });
          // console.log(varRef);
    
    },[]);

after that I run npm run start and got blank but in console, I am getting the Images.js:15 Uncaught TypeError: axios__WEBPACK_IMPORTED_MODULE_0__.Axios.get is not a function



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source