Please let me know if this is the right way to use modules on JavaScript
import React, { Component } from 'react';
import './App.css';
import logo from '../logo.png';
const ipfsClient = require('ipfs-http-client')
const ipfs = ipfsClient({host: 'ipfs.infura.io' , port:'5001', protocol : 'https'})
I am trying to link infura with IPFS and keep getting "TextDecoder is not a constructor" error, even though that does not seem to be the issue.