title: Return a string on button click in React hooks
body: <p>I am trying to print a string upon button click inside React hooks. </p>
  
  <p>This button called "More Info" is inside a return tag of a hook I created. (JSX) when this is clicked it calls another function component called "ChangeName" that should print a string.</p>
  
  <p>I am not sure if I am writing some wrong syntax or missing something? The console.log inside the function displays the string in the log but the div tag just doesn't print the string on the console,</p>
  
  <p>created a custom hook and the button is inside its return tag.</p>
  
  <pre><code> &lt;button onClick ={ChangeName}&gt;More Info &lt;button&gt;
  </code></pre>
  
  <p>onclick should call and print results from the below function</p>
  
  <pre><code> function ChangeName(){ 
           console.log("This is a test") //works
            return (&lt;div&gt;"This is a test"&lt;/div&gt;)
            }
  </code></pre>