score:1

Accepted answer
const result = await axios(
    `https://www.omdbapi.com/?s=${searchTitle}&type=movie&page=${searchPage}&y=${searchYear}&apikey=myapikeyhere`
);

score:1

const fetchItems = async () => {
      const result = await axios(
        `https://www.omdbapi.com/?s=${searchTitle}&type=movie&page=${searchPage}&y=${searchYear}&apikey=myapikeyhere`
      );
      if (result.data.totalResults) {
        console.log("fetching data:", result.data.Search);
        setQueryLength(result.data.Search.length);
        setMovieQuery(result.data.Search);
      } else {
        setMovieQuery([]);
        setQueryLength(0);
      }
      setLoading(false);
    };

Related Query

More Query from same tag