title: TypeError: Cannot read properties of undefined (reading 'then')
body: <p>I have an issue rendering this code in the browser, is there a way I can fix this? If there's more information needed, let me know? I receive the error at the componentDidMount. Is there something I am
  doing wrong.</p>
  <p>The PostService is posted at the bottom.</p>
  <pre class="lang-js prettyprint-override"><code>import React, { Component } from 'react';
  import PostService from '../services/PostService';
  
  class ListPost extends Component {
    constructor(props) {
      super(props);
      
      this.state = {
        posts: []
      };
    }
    
    componentDidMount(){
      PostService.getPosts().then((response) =&gt; {
        this.setState({ posts: response.data });
      });
    }
    
    render() {
      return (
        &lt;div&gt;
          &lt;h2 className=&quot;text-center&quot;&gt;Posts&lt;/h2&gt;
          &lt;div className=&quot;row&quot;&gt;
            &lt;table className=&quot;table table--striped table-boarded&quot;&gt;
              &lt;thead&gt;
                &lt;tr&gt;
                  &lt;th&gt;Title&lt;/th&gt;
                  &lt;th&gt;Description&lt;/th&gt;
                  &lt;th&gt;Content&lt;/th&gt;
                &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                {
                  this.state.posts.map(
                    post =&gt; 
                    &lt;tr key={post?.id}&gt;
                      &lt;td&gt;{post?.description}&lt;/td&gt;
                      &lt;td&gt;{post?.title}&lt;/td&gt;
                      &lt;td&gt;{post?.content}&lt;/td&gt;
                    &lt;/tr&gt;       
                  )}
              &lt;/tbody&gt;
            &lt;/table&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      )
    }
  }
  
  export default ListPost;
  
  
  import axios from &quot;axios&quot;;
  
  const POST_API_BASE_URL = &quot;http://localhost:8080/api/posts&quot;;
  
  class PostService {
      getPosts() {
          axios.get(POST_API_BASE_URL);
      }
  }
  
  export default new PostService();
  </code></pre>