Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
error in getMovies(text) declaration
getMovies = text => async () => { }
// другими словами ты возвращаешь async функцию
function getMovies(text) {
return async function() { }
}
// а надо так
getMovies = async text => {
try {
const URL = `https://api.tvmaze.com/search/shows?q=${text}`;
.....
renderPosts() {
if (this.state.error) {
return this.renderError();
}
return (
<ul>
{this.state.posts.map(post => (
<li key={post.show.id}>{post.show.name}</li>
))}
</ul>
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question