title: Creating custom function in React component
body: <p>I have a React component</p>
  
  <pre><code>export default class Archive extends React.Component { 
     ...
  }
  </code></pre>
  
  <p><code>componentDidMount</code> and <code>onClick</code> methods partially use the same code, except for slight change in parameters.</p>
  
  <p>Is it possible to create a function inside the component class so it can be reused in the scope of the component?</p>