0

i want to fetch the API to display tv series from tvmaze but whenever i used e.target.value to fetch all the tv series it doesn't fetch any value. However when i'm just fetching only one episode like Game of Thrones it works perfectly. Kindly review my code and help me to debug my code. i'll provide more code if anyone wants. Thanks

 class Series extends Component { state = { series: [], seriesName: '', isFetching: false } onSeriesInputChange = e => { this.setState({ seriesName: e.target.value, isFetching: true}); fetch('https://api.tvmaze.com/search/shows?q=${e.target.value}') .then(response => response.json()) .then(json => this.setState({ series: json, isFetching: false})); } `` 
0

1 Answer 1

3

if you're trying to use ${e.target.value} as part of ES6's string template literals, you need to use the grave accent `` quotes, not single quotes ' '

Sign up to request clarification or add additional context in comments.

2 Comments

hey man..thanksssssss it works perfectly now
no problem! glad it helped!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.