I am getting the data I need from the response, but I get a TypeError and I don't understand why? What do I need to do to fix this?
componentDidMount() {
const getData = axios.get("https://web-code-test-xxx-games-prd.appspot.com/cards.json")
.then(function(response) {
const easyResponse = response.data.levels[0]['difficulty']
const easyCards = response.data.levels[0]['cards']
this.setState({ easy: easyResponse})
this.setState({easyCards: easyCards})
})
.catch(function(error) {
console.log(error);
});
}