title: Helpers in stateless functional components
body: <p>With the introduction of Stateless functional components in react we have multiple ways to add helper methods to our component. What is the defined standard practice in regards to helper functions?</p>
  
  <p>The helper-functionis not indended to be a general utility function. (which means it is only used for this specific component)</p>
  
  <p>Place them inside the component-function?</p>
  
  <pre><code>export const myComponent = (props) =&gt; {
      const myHelper = (value) =&gt; {
          // Insert logic
      };       
  
      return &lt;div&gt;{myHelper(props.mystate.value)}&lt;/div&gt;;
  };
  </code></pre>
  
  <p>Place them outside the function, but in the same file? </p>
  
  <pre><code>const myHelper = (value) =&gt; {
      // Insert logic
  };
  
  export const myComponent = (props) =&gt; {    
      return &lt;div&gt;{myHelper(props.mystate.value)}&lt;/div&gt;;
  };
  </code></pre>
  
  <p>Or is there an alternative way that is commonly used?</p>