React字符串转义DOM

React字符串转义DOM

let dom = value;

if (row.documents?.length) {
    row.documents.map((item) => {
        dom = dom.replaceAll(item, `<a>${item}</a>`);
    });
}

return <div dangerouslySetInnerHTML={{ __html: dom }}></div>;
LICENSED UNDER CC BY-NC-SA 4.0