title: Using IPFS and Storing CIDs and Displaying Images
body: <p>I am trying to post an image to IPFS via 'ipfs-http-client', return the CID of the file I uploaded, then save the CID into state.</p>
  <p>Here is my main function:</p>
  <pre><code>const sendToIPFS = async (e: React.FormEvent&lt;HTMLFormElement&gt;) =&gt; {
          const ipfs = await create({ host: 'ipfs.infura.io', port: 5001, protocol: 'http', timeout: '2m' });
          const fileAdded = await ipfs.add({ path: '--only-hash', content: file });
          console.log(&quot;Added File: &quot;, fileAdded.cid)      
      };
  </code></pre>
  <p><a href="https://i.stack.imgur.com/pGi71.png" rel="nofollow noreferrer">Here is the Full Console Log of the above function.</a></p>
  <p>I want to return the console log with a string hash circled in RED in the photo.</p>
  <p>Any ideas?</p>