title: Should i create a variable or pass the parameter directly?
body: <p>I'm studying ReactJS and there are some (simple) questions that I can't find the answer to.</p>
  <p>For example, I have a component that sends a property to another component. To pass this property I have two alternatives. <strong>Create a constant, or just pass the property. Follow the examples</strong></p>
  <pre><code>const Component1 = ({ param }) =&gt; {
        return &lt;AnyOtherComponent otherComponentParam={param ? 'name1' : 'name2'} /&gt;
      }
      
      export default Component1
  </code></pre>
  <p>------------------------------- // ----------------------------------- // ---------------------</p>
  <pre><code>const Component2 = ({ param }) =&gt; {
    const otherParam = param ? 'name1' : 'name2'
    return &lt;AnyOtherComponent2 otherComponentParam={otherParam} /&gt;
  }
  
  export default Component2
  </code></pre>
  <p>Assuming I only use this constant to pass the property, ie I only use it once, what would be better?
  Create this constant variable or pass the property directly as in the first example?</p>
  <p>I think example 1 is the most correct, as I'm not allocating memory space to a variable that will only be used once. But I didn't find any text/article that makes this comparison</p>
  <p>I would like to have access to the texts of articles that talk about the serial subjects and better facts about which</p>