score:1
Accepted answer
it is a simple mistake =)
api.js:
const api = axios.get({
baseurl: 'https://api.covid19api.com',
})
in the above code, where you define your api, you should use axios.create
instead of axios.get
.
at the moment, if you look carefully, in your react component you're basically calling axios.get().get()
which doesn't make sense.
Source: stackoverflow.com
Related Query
- Unhandled Rejection (TypeError): keytar.setPassword is not a function
- Apexcharts - React js Unhandled Rejection (TypeError): t.every is not a function
- Unhandled Rejection (TypeError): this.props.callbackFunction is not a function
- Unhandled rejection TypeError: dbUser.validPassword is not a function Sequelize Node React Passport
- Unhandled Rejection (TypeError): respo.json is not a function
- Unhandled Rejection (TypeError): ships.reduce is not a function
- Unhandled Rejection (TypeError): state.push is not a function while using redux thunk
- Unhandled Rejection (TypeError): observer.complete.bind is not a function
- React error : Unhandled Rejection (TypeError): this.state.categories.map is not a function
- Unhandled Rejection (TypeError): result.push is not a function
- Unhandled Rejection (TypeError): setX is not a function
- Unhandled Rejection (TypeError): params.setLoggedIn is not a function
- Unhandled Rejection (TypeError): moralis__WEBPACK_IMPORTED_MODULE_1__.Moralis.start is not a function
- React Functional Component Parent and Child - Unhandled Rejection (TypeError): X is not a function
- Unhandled Rejection (TypeError): stripe.redirectToCheckout is not a function
- TypeError: cats.map is not a function and Unhandled Rejection (TypeError): cats.map is not a function
- Unhandled Rejection (TypeError): this.state.movie.map is not a function
- Unhandled Rejection (TypeError): callback is not a function
- Unhandled Rejection (TypeError): firebase_app__WEBPACK_IMPORTED_MODULE_18__.default.auth(...).updateProfile is not a function
- Firebase v9.01 - Unhandled Rejection (TypeError): productDoc.ref.collection is not a function
- Unhandled Rejection (TypeError): dispatch is not a function getting this error in action creator
- React js Unhandled Rejection (TypeError): t[l].data.map is not a function
- How to Fix Unhandled Rejection (TypeError): chat.setUser is not a function in Firechat by Firebase in React.js
- How to fix error: Unhandled Rejection (TypeError): meetups.map is not a function
- Unhandled Rejection (TypeError): api.getUser is not a function
- Unhandled Rejection (TypeError): setDailyData is not a function
- Unhandled Rejection (TypeError): setState is not a function
- Unhandled Rejection (TypeError): Object(...) is not a function
- React JS Unhandled Rejection (TypeError): item.persistVariablesLimit.trim is not a function
- React - Unhandled Rejection (TypeError): e.preventDefault is not a function
More Query from same tag
- React: Get state of children component component in parent
- Why am I receiving jwt malformed?
- how to store bearer token in cookies in react js frontend
- How to use React-router with {this.props.children}
- How to import PDF file with react-file-viewer in Next.js?
- Replace localhost in heroku
- Update state of multiple checkboxes in React with useState
- How to access and loop over nested JSON items in React?
- Multiple useState in useEffect, order of execution
- React - Close dropdown menu when clicking on the window
- Access object inside the array which is inside the other object
- React Unfocuses Input Field When Typing
- React Data being lost on page refresh arrow function
- Redux provider not provides the props to React Component on load
- Can I use useState inside HOC (High order component)?
- Three cards in a row instead of all cards in one column
- Can I use custom matcher with toHaveBeenCalledWith?
- what type to give ref in React/TypeScript?
- How to make unclickable icon inside clickable div?
- How to download binary file through axios get method in reactjs?
- IIS URL redirect on sub application holding react SPA
- useContext in reactJS with custom hook leading to undefined object
- How to use regex to constrain a ReactJS Route
- CSS Flex-box justify-self / align-self not working
- How to return JSON response of saved from a REST API (ExpressJS) when button clicked using ReactJS?
- VSCode Theme of React Documentation
- React Passing Component Function - cannot use in function
- Trigger parent function on ajax success in reactjs
- react redux / react thunks api
- Responsive images with <picture> and <source> in ReactJS