score:0

Accepted answer

you are not calling appropriate method of axios. use get() method

try this:

 searchmovies = async val => {
    this.setstate({ issearching: true })
    const res = await axios.get(
      `https://api.themoviedb.org/3/search/movie?api_key=${apikey}&language=en-us&query=${val}page=1&include_adult=true`;
    )
    const movies = await res.data.results;
    this.setstate({ movies: movies, issearching: false })
  }

score:1

i think you should use get() method in your searchmovies function.

const response = await axios.get('/user?id=12345');
console.log(response);

Related Query

More Query from same tag