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}));   
    }
    ``
Hammad Hassan
  • 606
  • 7
  • 20

1 Answers1

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 ' '

jtylerm
  • 482
  • 4
  • 15