title: Should const be outside function components in React.js?
body: <p>Some of my code got a review comment saying something like &quot;move const outside the function to avoid redeclaration&quot;. This was a normal function component, something like this:</p>
  <pre><code>export default function someComponent() {
    const someString = 'A string';
    ///...
  }
  </code></pre>
  <p>I was confused about the idea of this causing a redeclaration, because it does not, I know that the record that holds the variables and constants belong to the scope, so it's not exactly that.
  But then i remembered that typescript does not allows you to have a const inside a class, not sure about the reason or is this is related. But then ts added the readonly modifier in ts v2, so the confusion remains.</p>
  <p>Should const be outside function components, or not?
  I would love to know more opinions.</p>