Can anyone help me what am I doing wrong I can't get objects from this
(API key is not in the code). Some Suggestions for how to learn API would be nice. I want to at least console.log()
the JSON and go from there.
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props){
super(props);
this.state ={
error: null,
isLoaded: false,
items: []
};
}
componentDidMount() {
fetch("https://eun1.api.riotgames.com/lol/summoner/v3/summoners/by-name/EvilDex?api_key=", {mode: "no-cors"})
.then(res => res.json())
.then(
(result) => {
this.setState({
isLoaded: true,
items: result.items
})
},
(error) =>{
this.setState({
isLoaded: true,
error
})
}
)
}