title: React handleClick on component
body: <p>I am a complete newbie in React. I created a component which is a button. This component renders out an image, and my goal is to use this image as a favorite button. For now all I wanna do is log something in my console when I click the image. </p>
  
  <p>I used a handleClick event but I think that isn't that simple here's my component:</p>
  
  <pre><code>/**
   * Renders the Favorite button
   */
  export default class FavoriteButton extends React.Component
  {
      /**
       * Favorite button constructor
       *
       * @param props
       */
      constructor(props)
      {
          super(props);
  
          this.state = {
              header: "some header test data",
          }
      }
  
      /**
       * Handle a click event on a Favorite button
       */
      handleClick()
      {
          console.log("hello there");
      }
  
      /**
       * Renders the Favorite button
       */
      render()
      {
          return(
              &lt;div className="favorite_button"&gt;
                  &lt;img src="url" className="" alt="" /&gt;
                  &lt;div&gt;{this.state.header}&lt;/div&gt;
              &lt;/div&gt;
          );
      }
  }
  </code></pre>
  
  <p>If anyone can help me out that would be realy awesome!</p>
  
  <p>My ultimate goal is to fire a database action to store the element that you've favorited but for now I just wanna log something :)</p>
  
  <p>Many thanks in advance!</p>