fetch(){
    // line 28 is a simple debug line to make sure line 29 is inputing the right link
    // console.log('https://pokeapi.co/api/v2/pokemon/' + this.state.inputValue);

     // this line calls Axios to find the inputed pokemon from the text field
    Axios('https://pokeapi.co/api/v2/pokemon/' + this.state.inputValue)
    // if there is a response, then set it to this.state.pMon and then set this.state.loaded to true
    .then((response) => {
      this.setState({pMon: response.data});
      this.setState({loaded: true})
    })
    // simple error catch (not really sure if it works and probably irrelevant and unneeded)
    .catch((error) =>{
      this.setState({loaded: false})
    })
  }
// this is a method to retrieve data from Axios
this is a method to retrieve data from Axios
this is a method to retrieve data from Axios
fetch(){
    Axios('https://pokeapi.co/api/v2/pokemon/' + this.state.inputValue)
    .then((response) => {
      this.setState({pMon: response.data});
      this.setState({loaded: true})
    })
    .catch((error) =>{
      this.setState({loaded: false})
    })
  }
fetch ( ) { Axios ( 'https://pokeapi.co/api/v2/pokemon/' + this . state . inputValue ) . then ( ( response ) => { this . setState ( { pMon : response . data } ) ; this . setState ( { loaded : true } ) } ) . catch ( ( error ) => { this . setState ( { loaded : false } ) } ) }
this is a method to retrieve data from Axios
this is a method to retrieve data from Axios
// line 28 is a simple debug line to make sure line 29 is inputing the right link // console.log('https://pokeapi.co/api/v2/pokemon/' + this.state.inputValue); // this line calls Axios to find the inputed pokemon from the text field // if there is a response, then set it to this.state.pMon and then set this.state.loaded to true // simple error catch (not really sure if it works and probably irrelevant and unneeded)