import ReactHtmlParser from 'html-react-parser' ; export const parseToHtmlWithTags = ( text , tags ) : string | JSX . Element | JSX . Element [ ] => { let words = text ; tags . forEach ( ( word ) => { words = words . replace ( word , `<span>${ word }</span>` ) ; } ) ; return ReactHtmlParser ( words ) ; } ; export const parseToHtml = ( body ) : string | JSX . Element | JSX . Element [ ] => { return ReactHtmlParser ( body ) ; } ;