O
O
olifem2018-11-15 16:09:46
JavaScript
olifem, 2018-11-15 16:09:46

How to output html tags from object/json?

import - convert json to object but how to convert html?
And make of it

const kek = {
text: "<b>SAMPLE TEXT</b><br>..."
}

from this
SAMPLE TEXT
...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shmatuan, 2018-11-15
@olifem

First google search -_-

render: function() {
    return (
        <div className="content" dangerouslySetInnerHTML={{__html: kek.text}}></div>
    );
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question