Movie info website (React, axios and Semantic UI) import React, { Component } from 'react';
import { Grid, Header, Divider, Image, Embed, Button, Icon } from 'semantic-ui-react'
import axios from 'axios';

class Movie extends Component {
  constructor(props) {
    super(props);
    this.state = {
      title: '',
      year: '',
      poster: '',
      plot: '',
      rating: '',
      genres: '',
      runtime: ''
    };
  }

  componentWillMount() {
    axios.get('http://www.omdbapi.com/?i=tt0096895')
      .then((response) =&gt; {
      console.log(response.data);
        this.setState(
          {
            title: response.data.Title,
            year: response.data.Year,
            poster: response.data.Poster,
            plot: response.data.Plot,
            rating: response.data.imdbRating,
            genres: response.data.Genre,
            runtime: response.data.Runtime
          })
      })
      .catch((err) =&gt; {
        console.log(err);
      });
  }

  render() {
    return (
      &lt;div&gt;
        &lt;Grid container&gt;
          &lt;Grid.Column width={5}&gt;
            &lt;Image
              src={this.state.poster}
              fluid
            /&gt;
            &lt;Button attached='top'&gt;
              &lt;Icon name='plus'/&gt;
              Add to watchlist
            &lt;/Button&gt;

            &lt;Divider section/&gt;

            &lt;h4&gt;RATING&lt;/h4&gt;
            &lt;img className='imdb-icon' src="https://lh3.googleusercontent.com/lOC6oCAWrB7TNqvPdgJkQzUyC2pLc63n0iLCBtIE9CF-FFUjbbiAyW9AUPiCfkz3nOUxNE0SVZtxGsKRwDPsHqpOuHYadm2lEhx6wfobYyoPp8CfV3tO65ZTjJ8-91vT9Q7lwrOvDQF_sIOUGJ32TeIYdgWXHLiM3RNYS5LUq1fL71l5nL_37He7XokgUO6lbuwPOm7nNEAyBuyQgYzPgB-hxkzSGeUg6o4Tp7dAz8O3X6Cuhhxew-N23-zgqr4ag3dZ9L4De21WLO-WppAmgh752F4uY4Zt-IrbtxldHnOkve8OX3ktlRCHkrtcdHVL9jCWruyBpn3KZhL2fuMZ9oeWSVU3v4Gpkxb5xlh3MTveT8N45ih3WAYoP6Hm-Jz8qAhMQpfnmSRGzuQaX22FITypo_XeKcvkoSLUQMC1V68nuWcOT2MphDFyMgTjunmLBca74UpL5s3k2_FhJfS0RX0k0Y6IC6bUOL5gWcEu0d4rJv8iJHnXKft4zohH4PryAuE-G2q7rs4Vnb_65grz89QQGmF6OLGUhZowBfnGD8_MRE6Ev9Q92x8hMSFWZJZsz2wNk0eUxnCVSJFNVO1jphG2bSHy6ojYNVe9b-JVVQ3NlJr9KjB6=w64-h32-no"/&gt;
            &lt;span&gt;{this.state.rating}&lt;/span&gt;

            &lt;h4&gt;GENRES&lt;/h4&gt;
            &lt;p&gt;{this.state.genres}&lt;/p&gt;

            &lt;h4&gt;RUNTIME&lt;/h4&gt;
            &lt;p&gt;{this.state.runtime}&lt;/p&gt;

            &lt;Divider section/&gt;
          &lt;/Grid.Column&gt;
          &lt;Grid.Column width={11}&gt;
            &lt;Header as='h2' inverted&gt;
              {this.state.title}
              &lt;Header.Subheader&gt;
                ({this.state.year})
              &lt;/Header.Subheader&gt;
            &lt;/Header&gt;

            &lt;Embed id='O6Xo21L0ybE' source='youtube'/&gt;

            &lt;h4&gt;PLOT&lt;/h4&gt;
            &lt;p&gt;{this.state.plot}&lt;/p&gt;
          &lt;/Grid.Column&gt;
        &lt;/Grid&gt;
      &lt;/div&gt;
    );
  }
}

export default Movie;


I am very new to React. This is for a school project and I would love to if someone reviewed my code. What improvements can I do?
Some things I would change:


Make initial state look like this:

this.state = {
    movie: null
};

Instead of making the api request in componentWillMount, do it in componentDidMount because componentWillMount is considered legacy.
In componentDidMount be more declarative, which means to be more descriptive of what you are doing, so call a method that gets the movie like this:

componentDidMount() {
    this.getMovie();
}



getMovie() would look like this:

getMovie() {
    axios
      .get("http://www.omdbapi.com/?i=tt0096895")
      .then(response =&gt; {
        const movie = {
          title: response.data.Title,
          year: response.data.Year,
          poster: response.data.Poster,
          plot: response.data.Plot,
          rating: response.data.imdbRating,
          genres: response.data.Genre,
          runtime: response.data.Runtime
        };
        this.setMovie(movie);
      })
      .catch(err =&gt; {
        console.log(err);
      });  
}


setMovie(movie):

setMovie(movie) {
    this.setState({ movie });
}



Lastly, in your render, I would check if there was a movie on state before rendering anything, if there is no movie, display some text saying no movie.

render() {
    if (!this.state.movie) {
      return &lt;p&gt;No movie found.&lt;/p&gt;;
    }

    return (
        ...what you currently have
    );
}