title: Show <div> only if prop is defined
body: <p>I want to show an icon for a React component only if it was defined.
  This is my code:</p>
  <pre><code>export const Button = ({ children, link, icon, background }) =&gt; {
    return (
      &lt;Link href={`${link}`} passHref&gt;
        &lt;button
          className={`mt-4 inline-flex px-5 py-3 rounded-xl text-base font-medium text-white ${background} hover:bg-indigo-800 active:bg-grey-900 focus:outline-none border-4 border-white focus:border-purple-200 transition-all`}
        &gt;
          {children}
          {this.props.icon ? &lt;Icon path={`${icon}`} /&gt; : null}
        &lt;/button&gt;
      &lt;/Link&gt;
    );
  };
  </code></pre>
  <p>But when I run it I get a 'TypeError: Cannot read property 'props' of undefined'
  Any idea how to fix it?</p>