title: Unable to use const within a class in React
body: <p>I am following this tutorial </p>
  
  <p><a href="https://nickymeuleman.netlify.com/blog/gatsby-pagination#navigate-to-previousnext-page" rel="nofollow noreferrer">https://nickymeuleman.netlify.com/blog/gatsby-pagination#navigate-to-previousnext-page</a></p>
  
  <p>Everything is working fine, but I am unable to add const within the class. I am using VSC to code up the site, it just doesn't seem to like it. </p>
  
  <p>This is the class I am trying to place the consts within. As I am new to React I am bit lost on finding a solution without using a plugin.</p>
  
  <pre><code>export default class PostList extends React.Component {
      render() {
          const posts = this.props.data.allMarkdownRemark.edges
          return (
              &lt;Layout&gt;
                  &lt;Head title="Posts" /&gt;
                  &lt;div className={layoutStyles.pageHeader}&gt;
                      &lt;h2&gt;Posts&lt;/h2&gt;
                      &lt;span&gt;Just my ramberlings&lt;/span&gt;
                  &lt;/div&gt;
                  {posts.map(({ node }) =&gt; {
                      const title = node.frontmatter.title || node.fields.slug
                      return (
                          &lt;div className={postPageStyles.postItem}&gt;
                              &lt;div className={postPageStyles.postItemTitle}&gt;
                                  &lt;h2&gt;{title}&lt;/h2&gt;
                                  &lt;span&gt;Posted on {node.frontmatter.date}&lt;/span&gt;
                              &lt;/div&gt;
                              &lt;div&gt;
                                  &lt;p&gt;{node.excerpt}&lt;/p&gt;
                                  &lt;Link to={`${node.fields.slug}`}&gt;
                                      &lt;span&gt;Continue Reading&lt;/span&gt;
                                      &lt;span role="img"&gt; &lt;/span&gt;
                                  &lt;/Link&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      )
                  })}
              &lt;/Layout&gt;
          )
      }
  }
  </code></pre>