title: Use if else to declare a `let` or `const` to use after the if/else?
body: <p>I'm not sure why but it seems that I can't call the <code>let</code> or <code>const</code> variables if I declare them in an <code>if/else</code> statement.</p>
  
  <pre><code>if (withBorder) {
    const classes = `${styles.circularBorder} ${styles.dimensions} ${styles.circularPadding} row flex-items-xs-middle flex-items-xs-center`;
  } else {
    const classes = `${styles.dimensions} ${styles.circularPadding} row flex-items-xs-middle flex-items-xs-center`;
  }
  return (
    &lt;div className={classes}&gt;
      {renderedResult}
    &lt;/div&gt;
  );
  </code></pre>
  
  <p>If I use this code it says that <code>classes is not defined</code>.</p>
  
  <p>But if I change the <code>const</code> to <code>var</code> classes is defined but I get a warning about <code>classes used outside of binding context</code>and <code>all var declarations must be at the top of the function scope</code></p>
  
  <p>How could I fix this?</p>