Why doesn't a simple search?

April 3rd 20 at 18:51
1 answer
April 3rd 20 at 18:53
Solution
error in the ad getMovies(text)

getMovies = text => async () => { }
// in other words you're returning async function
function getMovies(text) {
 return async function() { }
}

// and be so
getMovies = async text => {
 try {
 const URL = `https://api.tvmaze.com/search/shows?q=${text}`;
.....


and then slightly change
renderPosts() {
 if (this.state.error) {
 return this.renderError();
}

 return (
the <ul>
 {this.state.posts.map(post => (
 <li key={post.show.id}>{post.show.name}</li>
))}
</ul>
);
 }
Thank you! - lore commented on April 3rd 20 at 18:56

Find more questions by tags React