concatenate SVG along with html

175 Views Asked by At

I have an SVG, i want to add that svg in front of some html data.

import * as Parser from 'html-react-parser';

var loadingLogo = require('./img/loading.svg');
var htmlData = 'hello <b>World</b>'


let imgTag = Parser(loadingLogo);
imgTag.props.height = "20";
imgTag.props.width = "100";

var output = imgTag + htmlData

This is what i get

[object Object]hello World

how to make it work so that i have an svg image along with the html

1

There are 1 best solutions below

0
On

okay since i couldnt figure it out, i did this, thought i am sure there is a better way

var outPut = Parser('{*theentiresvgcode*}' + htmlData);