Hi. I’m trying to do an ajax call using axios, but it returns me an error in console:
Fetch Error :-S TypeError: Cannot read property 'entry' of undefined(…)
I’ve checked it in https://resttesttest.com/ and it returns me correct response and status 200.
Here’s an extract of code:
constructor () {
super()
this.state = {
sheetData: []
}
}
componentDidMount () {
axios.get(`https://spreadsheets.google.com.../public/basic?alt=json`)
.then((response) => {
this.setState({sheetData: response.feed.entry})
console.log(response)
})
.catch((error) => {
console.log('Fetch Error :-S', error)
})
}