Skip to main content

All Questions

0 votes
1 answer
2k views

TypeError: axios__WEBPACK_IMPORTED_MODULE_1___default.a.get(...).than is not a function

I start recently ReactJS. However I'm not very familiar with ReactJS specially with axios. In this project I'm getting the data from the API. but it will trigger the given below error. "TypeError:...
Ihtisham Khattak's user avatar
0 votes
3 answers
843 views

React JS useEffect hook send infinite no of request if i add an dependency

i have made an API in Django for fetching the TODO list tasks in my React JS Application but when i use allTasks of useState in dependency array of useEffect Hook then it starts sending endless get ...
user avatar
4 votes
1 answer
2k views

how to pass react hook objects to axios interceptor from index.js in react

I want to use axios request and response interceptor to show/hide loader before and after each request. For this I using redux to maintain loader state, But I can not use useDispatch and useHistory ...
Amit Kumar's user avatar
  • 5,962
1 vote
5 answers
1k views

React fetch data before render class component

I have tried every option i can find myself but i am not understanding what am i doing wrong. My axios get data update but when i use conditions it always render the first state data. this is my code. ...
CoderBoy's user avatar
0 votes
1 answer
35 views

My props value for 'streams' is always undefined

I'm finding that no matter that I do, my value for this.props.streams is always undefined. I have confirmed that the backend API is returning values when queried. Example output: { "...
Newsworthy's user avatar
1 vote
2 answers
2k views

React proxy, the server responded with a status of 404 (Not Found)

By default I am running at localhost: 3000. I want to send a request to localhost: 8072 with the proxy setting. I've done proxy settings and I'm getting an error. In addition terminal shows an erorr ...
Mert Hana's user avatar
0 votes
1 answer
206 views

Redux and React: Unhandled Rejection (TypeError): Cannot read property 'push' of undefined

In the Redux action file code, I am trying to implement history.push('/userfeed') when user has successfully logged in. However, I keep getting the following error: Unhandled Rejection (TypeError): ...
tim_woods's user avatar
  • 417
0 votes
1 answer
1k views

Add dynamic data in XML body for AXIOS Post

I need to post a request using AXIOS. The request body is in XML format. I am able to POST a request using static data in XML body using AXIOS but wanted to pass the value dynamically. Can you please ...
ammy's user avatar
  • 87
0 votes
1 answer
813 views

If backendserver is down then How to handle in Reactjs with Axios

Current I am using Axios to fetch data from backend , if the backend is down then how to handle it. Right now if the user directly access somepage in the APP without login, it will show him the page ...
SHUBHAM DEKATE's user avatar
1 vote
3 answers
3k views

React axios.get not working it's says failed to compile

I am new in React . I am trying to get my api data with axios . But getting error . My code are : import React from 'react'; import ReactDOM from 'react-dom'; import axios from 'axios'; import ...
MD. Jubair Mizan's user avatar
1 vote
1 answer
38 views

I made a voteapp with react.js, used styled-components but in index.html rendering all

An error occurred while designing with scheduled-components The error is caused by overlapping components. I set up the url using route. The first component that comes out is the app component, but ...
Wonlf's user avatar
  • 61
-1 votes
1 answer
507 views

prop returns Null when component renders

I am trying to add some functionality that enables or disables a button depending on whether the user has at least one "credit". I want to use the logical && to determine whether to enabled or ...
Jameson's user avatar
  • 408
5 votes
3 answers
34k views

"Uncaught TypeError: Cannot read property 'type' of undefined" and unclear what it is related to

I originally thought this was an issue with react-redux, axios, lodash, and/or react-dropzone; however, files are uploading fine, but this error still triggers. (Even though it is says "failed" in ...
cheslijones's user avatar
  • 9,214
1 vote
1 answer
2k views

Redux loses state when navigating to another page using react-router 'history.push'

(as you can see my reputation is not very high :) and I understand that if you don't like my question it is going to be my last one, therefore I am going to write it as good as I can :) The problem I ...
Yossi's user avatar
  • 6,047
0 votes
2 answers
2k views

how to call ajax in react using `redux-thunk`?

I am trying call ajax in react using redux-thunk and axios .I want to get data from json file simple way (on button click call like this) axios.get('data.json').then((data)=>{ console....
user944513's user avatar
  • 12.8k