Render Dynamic Html In React Js
I want to render a dynamic html text provide by a API in react js but I don't know how to do. for example : dynamicHtml=
hello StackOverFlow &
Solution 1:
use dangerouslySetInnerHTML
function createMarkup(text) { return {__html: text}; };
<render() {
return (
<div dangerouslySetInnerHTML={createMarkup()} />
);
}
Post a Comment for "Render Dynamic Html In React Js"