title: Gatsby: img is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`
body: <p>I am trying to build a component with Gatsby Js that includes a image that is imported. However when a link is added with the anchor HTML tag, I am receiving <code>img is a void element tag and must neither have</code>children<code>nor use</code>dangerouslySetInnerHTML`. </p>
  
  <p>Without <code>&lt;a&gt; ... &lt;/a&gt;</code> there is no such error.</p>
  
  <p>My code:</p>
  
  <pre><code>import React from "react"
  import medium from "../images/medium.png"
  
  
  const Socials = () =&gt; (
      &lt;div&gt;
          &lt;a href="https://medium.com"&gt; &lt;img src={medium}&gt; &lt;/img&gt; &lt;/a&gt;
      &lt;/div&gt;
  )
  export default Socials
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>  in img (at Socials.js:8)
      in a (at Socials.js:8)
      in div (at Socials.js:7)
      in Socials (at pages/index.js:44)
      in IndexPage (created by HotExportedIndexPage)
      in AppContainer (created by HotExportedIndexPage)
      in HotExportedIndexPage (created by PageRenderer)
      in PageRenderer (created by JSONStore)
      in JSONStore (created by RouteHandler)
      in RouteHandler (created by EnsureResources)
      in div (created by FocusHandlerImpl)
      in FocusHandlerImpl (created by Context.Consumer)
      in FocusHandler (created by RouterImpl)
      in RouterImpl (created by Context.Consumer)
      in Location (created by Context.Consumer)
      in Router (created by EnsureResources)
      in ScrollContext (created by EnsureResources)
      in RouteUpdates (created by EnsureResources)
      in EnsureResources (created by LocationHandler)
      in LocationHandler (created by LocationProvider)
      in LocationProvider (created by Context.Consumer)
      in Location (created by Root)
      in Root
      in _default
  
  </code></pre>
  
  <p>What is the correct way to add an URL link to an image?</p>