title: Render function only once in React
body: <p>I need to run a random number generator only once (and never re render), I'm trying to use useCallback but I must be doing something wrong since it's not returning any value.</p>
  
  <pre><code>function Editor() {
  
      function genRandom() {
      const random = Math.floor(Math.random() * (2 - 0) + 0);
      return random;
      }
  
  
      const randomNum = useCallback(() =&gt; {
          genRandom();
      }, []);
  
  
      console.log(randomNum);
  }
  
  export default Editor;
  </code></pre>
  
  <p>randomNum is not returning anything at all.</p>