//https://flaviocopes.com/react-fix-dangerouslysetinnerhtml-did-not-match/
<div
dangerouslySetInnerHTML={{
__html: '<p>test</p>'
}}></div>
function createMarkup() {
return {
__html: 'First · Second' };
};
<div dangerouslySetInnerHTML={createMarkup()} />
function createMarkup() {
return {__html: 'First · Second'};
}
function MyComponent() {
return <div dangerouslySetInnerHTML={createMarkup()} />;
}
dangerouslySetInnerHTML={{__html: 'string'}}
function MyComponent() {
const markup = { __html: 'First · Second' }
return <div dangerouslySetInnerHTML={ markup } />;
}